...

View Full Version : width issues with ie6



nimaha
12-13-2007, 08:17 AM
I've recently been trying to fix a couple of my sites that have problems in ie6. I just got into this about a year ago and didn't even know what css was before ie7 came out, so I'm totally lost on IE6 and its many bugs.

One in particular is its treatment of widths and padding/margins. Below is a couple snippets of code. What's happening is that in Firefox, IE7 and Opera, my vertical menu is lining up perfectly within the space I give it. In IE6, though, it is pushed to the right by about an extra 1 or 2 px.

Even worse, when I add padding to the left and right on the #nav li a snippet,
IE 6 expands the entire menu whereas the other browsers simply give the padding I need.

I'm guessing this is a "newbie" thing so any help you can provide is much appreciated.



#nav {
width: 118px
padding: 0;
margin: 8px 0 8px 0;
font-family:Geneva, Arial, Helvetica, sans-serif;
background-color: none;
color: #333;
list-style:none;
}
#nav li a {
display: block;
padding: 5px 0 5px 0;
background-color:#01409e;
color: #fff;
text-decoration: none;
width: 100%;
}

abduraooft
12-13-2007, 08:23 AM
A link to your page would be more useful!

nimaha
12-13-2007, 06:08 PM
Link to site (http://www.littlebitoforegon.com/azcondos/condo1/)

I don't actually have hosting yet, so it's on a different domain.

Thanks for taking a look.

Excavator
12-13-2007, 07:31 PM
Good morning nimaha,
I don't have anything with IE6 running right now... but it looks like your box model is off. Google box model for plenty of explanations.

In the example below, I switched from using em to px since the rest of the measurements are in px. I think it's better to stick with one measurement, sure makes the math easier.

#nav-container {
float:left;
width:120px;
margin:0 0 10px 0;
}
#body-container {
margin:10px 12px 10px 130px;
}
#nav {
width: 110px;
margin: 5px;
padding: 0;
font-family:Geneva, Arial, Helvetica, sans-serif;
background-color: none;
color: #333;
list-style:none;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum