• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3286
  • Last Modified:

CSS Position doesnot work in IE8

I am trying to stop using tables and place objects with CSS. Dreamweaver shows the objects where I want them but when I render in IE8 everythign piles up in the upper left corner instead of spreading out around the page according to my top: and left: attributes. What am I doing wrong?
<body leftmargin="0" topmargin="0" background="images/CheckerBoard.jpg">
<div id="logo"><img src="images/DGLogo.gif" /></div>
<div id="MenuItem1"><img src="images/MenuSites.gif" /></div>	
<div id="MenuItem2"><img src="images/MenuAbout.gif" /></div>
<div id="MenuItem3"><img src="images/MenuPhotos.gif" /></div>	
<div id="MenuItem4"><img src="images/MenuEvents.gif" /></div>
</body
 
CSS File:
body {
	font-family: Arial, Helvetica, sans-serif;
}
 
#logo { 
position:absolute; 
top:0; 
left:100; 
width:329px; /*Width of Logo */ 
height:211px; /Height of Logo */
} 
 
#MenuItem1 { 
position:absolute; 
top:170; 
left:472; 
width:92px; /*Width of Logo */ 
height:41px; /Height of Logo */
} 
#MenuItem2 { 
position:absolute; 
top:170; 
left:582; 
width:92px; /*Width of Logo */ 
height:41px; /Height of Logo */
}
#MenuItem3 { 
position:absolute; 
top:170; 
left:692; 
width:92px; /*Width of Logo */ 
height:41px; /Height of Logo */
}
#MenuItem4 { 
position:absolute; 
top:170; 
left:802;
width:92px; /*Width of Logo */ 
height:41px; /Height of Logo */
}

Open in new window

0
Mannezman
Asked:
Mannezman
1 Solution
 
Mark StegglesWeb DeveloperCommented:
Greetings,

Check your code at the validator http://validator.w3.org/

One thing I can see is that all values need a unit except if they are 0, so:

left:100;

should be

left:100px;

--

On a side note: beware of using absolute positioning for your whole document. Absolute positioning takes elements out of the flow, so if you have elements that need to grow with content then using all absolute positioning could be a problem for you

Thanks
Steggs
0
 
MannezmanAuthor Commented:
Thanks, I feel kinda silly that I didn't see that! Yeah, I'm only using absolute for a few objects that I want to place over others.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now