We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

CSS Position doesnot work in IE8

Mannezman
Mannezman asked
on
Medium Priority
3,302 Views
Last Modified: 2012-05-06
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

Comment
Watch Question

Web Developer
CERTIFIED EXPERT
Top Expert 2006
Commented:
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

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

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.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.