| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
is gta4 addicted..
Join Date: Apr 2008
Location: San Diego, CA
Posts: 24
|
IE issue
I finally got the basic layout to look good in firefox, then I decide to preview it in IE and whoa! everything is thrown off way to the right that I have to scroll to view the whole content. Anybody know what I'm doing wrong or how to fix this ?? CSS + HTML: body { margin: 0; padding: 0; text-align: center; background: #000000; } #container { margin: 0 auto; width: 80%; } #contentBack { position:absolute; top: 0; z-index: 0; background-image: url(images/bg2.png); background-repeat: repeat-y; width: 975px; height: 100%; } #contentFront { position: absolute; top: 0; z-index: 1; margin-left:25px; background-image: url(images/WSNEW.png); width: 925px; height: 100%; } - <body> <div id="container"> <div id="contentBack"></div> <div id="contentFront"></div> </div> </body> </html> |
|
|
|
|
|
#2 (permalink) |
|
Moderator
Join Date: Jan 2005
Location: Brooklyn, NYC
Posts: 11,869
|
Why are you using absolute positioning again? Find good advice in the beginners web design thread.
patrick o'neill web developer | blog | spam humor |
|
|
|
#4 (permalink) |
|
Registered User
Join Date: May 2008
Posts: 6
|
Without seeing the design it's hard to know exactly, but it looks like you could build this more easily without absolute positioning. Like this maybe: body { margin: 0; padding: 0; text-align: center; background: #000000; } #contentBack { width: 975px; height: 100%; margin:0 auto; background-image: url(images/bg2.png); background-repeat: repeat-y; } #contentFront { margin-left:25px; width: 925px; height: 100%; background-image: url(images/WSNEW.png); } - <body> <div id="contentBack"> <div id="contentFront"></div> </div> </body> |
|
|
|
#5 (permalink) |
|
is gta4 addicted..
Join Date: Apr 2008
Location: San Diego, CA
Posts: 24
|
Good call. I am not using this layout anymore, and I'm also trying to avoid absolute positioning as much as possible after reading more about it in many CSS articles and books. It gets kind of unpredictable with different resolutions and browsers I guess, especially IE. |
|
|
|
#8 (permalink) |
|
shouting at a monitor!
Join Date: May 2008
Location: Glasgow, Scotland
Posts: 10
|
not that Absolute positioning is bad, it has its place... maybe just not for layout. A small tip for you, (you may know this, but allot of people dont), if you have a 200px wide div, and you add a left and right padding of 10px, you need to subtract 20px from the width, this may clear up some IE issues for you. Again, you may well know this... just a bit of friendly advice in case you didnt hehe. |
|
|
|
#9 (permalink) |
|
shouting at a monitor!
Join Date: May 2008
Location: Glasgow, Scotland
Posts: 10
|
Also, it helps if you "zero down" all your elements, i make it a habit to add margin: 0px; padding 0px; To almost all my elements, as some browsers default margins and paddings are slightly different, if you dont do this.. the browser will set its own margin/padding on certain elements. |
|
|
|
#12 (permalink) | |
|
Moderator
Join Date: Jan 2005
Location: Brooklyn, NYC
Posts: 11,869
|
Quote:
"My own code." Find good advice in the beginners web design thread.
patrick o'neill web developer | blog | spam humor |
|
|
![]() |