Forum Moderators: not2easy

Message Too Old, No Replies

More List Alignment Problems

Can't make list look the sme in IE and Firefox

         

cstricklen

3:58 pm on Dec 13, 2006 (gmt 0)

10+ Year Member



How in the world can I make this list look the same in IE and Firefox? Right now it looks the way I want it in IE, but in Firefox the left side of the list escapes the subNav div on the left side and ignores the padding on contDetail. When I get it right in Firefox, of course, it's too far right in IE. I've come up against this IE bug before and fixed it; I don't know what is different here. I've tried every combination of trial and error I can think of.

#containter {
width: 420px;
margin: 0;
text-align: left;
padding: 0 15px 0 15px;
border-right: 1px solid #ddd;
border-left: 1px solid #ddd;
}

#contDetail {
width: 420px;
margin: 0 auto 0 auto;
padding: 0;
text-align: center;
}

#subNav {
width: 250px;
margin: 0 auto 0 0;
text-align: left;
}

#subNav ul {
list-style-type: none;
margin: 0;
padding: 0;
position: relative; /*For some reason, this prevents the disappearing background images in IE*/
}

#subNav li {
margin: 0 2px 0 0;
padding: 0;
}

#subNav a {
background-image: url(images/arrow_right.gif);
background-position: 0 2px;
background-repeat: no-repeat;
padding-left: 8px;
}

#subNav a:hover {
background-image: url(images/arrow_right_70.gif);
background-position: 0 2px;
background-repeat: no-repeat;
text-indent: 0;
padding-left: 8px;
}

<body>
<html>
<div id="container">
<div id="someStuff"></div>
<div id="contDetail">
<div id="subNav">
<ul class="subNav">
<li>list item one</li>
<li>list item two</li>
<li>etc</li>
</ul>
</div><!--close subNav-->
<div id="someMoreStuff">
<h2>Heading</h2>
<h3">Heading</h3>
<ul>
<li>list item one</li>
<li>list item two</li>
</ul>
</div><!--close someMoreStuff-->
</div><!--close contDetail-->
</div><!--close container-->
</body>
</html>

holyhttp

4:27 am on Dec 14, 2006 (gmt 0)

10+ Year Member



Hi,

You need to make sure your DTD is in strict mode for the box model to look the same in IE and FF.

cstricklen

11:22 am on Dec 15, 2006 (gmt 0)

10+ Year Member



It is not in quirks mode. All of my pages look identical in various browsers--or close enough not to matter. But it seems I'm not smart enough to figure this one out.

I'm aware of the margin/padding difference between browser renderings when it comes to lists--or at least lists in nested divs--but I need to learn how to fix this.