| | |
can you explain ie7? (fixed position, width 100%)
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2009
Posts: 1
Reputation:
Solved Threads: 0
I just spent several hours trying to figure out how to fix my websites appearance in ie7. I've found a solution, but I have no clue why it actually worked. I'm looking for an explanation if anyone has one.
My goal was to have a fixed position div across the top of my website. It would have a solid image centered in it that was the width of the content not the screen. When you scroll the page the text should go underneath the bar. I also wanted the bar centered within the width of the screen (since my site is also centered). That way, if the screen was resized the bar would still be centered over the content.
I tried several css methods to achieve this. What I tried worked in EVERY other browser, but not IE7 (don't ask about IE6, I don't develop for it anymore). Here's what I had:
Ie7 didn't know how to handle 100% width. my bar was always ~200 pixels to the right of where it should have been. With everything I tried the bar didn't budge from its off-center position. I finally decided I just needed to effect it somehow. What finally worked was adding a width that only 1e7 could read:
Note that 1220px is the size of the content container div.
This solution really doesn't make any sense to me. Can anyone help me understand why this worked?
My goal was to have a fixed position div across the top of my website. It would have a solid image centered in it that was the width of the content not the screen. When you scroll the page the text should go underneath the bar. I also wanted the bar centered within the width of the screen (since my site is also centered). That way, if the screen was resized the bar would still be centered over the content.
I tried several css methods to achieve this. What I tried worked in EVERY other browser, but not IE7 (don't ask about IE6, I don't develop for it anymore). Here's what I had:
#upperBarWrap {
position:fixed;
text-align:center;
margin:0;
width:100%;
}
#upperBar {
width:1200px;
height:38px;
margin:0px auto;
background-image:url(images/layout/upperBar1.png);
background-repeat:no-repeat;
background-position:top left;
text-align:left;
}Ie7 didn't know how to handle 100% width. my bar was always ~200 pixels to the right of where it should have been. With everything I tried the bar didn't budge from its off-center position. I finally decided I just needed to effect it somehow. What finally worked was adding a width that only 1e7 could read:
#upperBarWrap {
text-align:center;
margin:0;
position:fixed;
width:100%;
*width:1220px;
}This solution really doesn't make any sense to me. Can anyone help me understand why this worked?
•
•
Join Date: Jan 2009
Posts: 77
Reputation:
Solved Threads: 11
0
#2 17 Days Ago
Try this:
Set 'left=0' property to say IE where the fixed position start.
HTML and CSS Syntax (Toggle Plain Text)
#upperBarWrap { margin:0; position:fixed; For /* IE */ left: 0; width:100%; }
•
•
Join Date: Oct 2009
Posts: 14
Reputation:
Solved Threads: 1
0
#3 15 Days Ago
•
•
•
•
Try this:
Set 'left=0' property to say IE where the fixed position start.HTML and CSS Syntax (Toggle Plain Text)
#upperBarWrap { margin:0; position:fixed; For /* IE */ left: 0; width:100%; }
Or try a support
Network management tools provides security, scalability and flexibility in you network.
![]() |
Similar Threads
- width 100% IE/FF difference (HTML and CSS)
- Adding text to Slideshow script for images (JavaScript / DHTML / AJAX)
- Problem with "position:fixed;" on IE7 (HTML and CSS)
- div floats and width 100% (HTML and CSS)
- To place an exe program in a fixed position in a php page (PHP)
Other Threads in the HTML and CSS Forum
- Previous Thread: a strange problem with ie
- Next Thread: <TR> takes viewport size in IE6,7.
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7






