Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lists & sublists in IE and Netscape

Status
Not open for further replies.

TheInsider

Programmer
Jul 17, 2000
796
CA
Hello,

The following is simply a rough concept page -- that's why it looks so poorly coded. I am trying to get the vertical spacing of the <li> tags to be exactly the same between IE 6 and Netscape 7.

The sublist should also not have any different vertical spacing than its parent.

Right now if you view this page in IE 6 and then flip to it in Netscape 7, you will see that the list item spacing is slightly wider, vertically, in IE 6. As you increase the css margin and/or padding the difference in spacing between the 2 browsers becomes much more noticable. (Note: bullet.gif is simply 5x5 pixels)
Code:
<html>
<head>
<style type=&quot;text/css&quot;>
li
{
font-family:verdana;
font-size:12px;
vertical-align:middle;
margin:	0px 0px 5px 0px;
padding: 0px 0px 0px 15px;

list-style-type: none;
background-image: url(bullet.gif);
background-repeat: no-repeat;
background-position: 0 4px;
}

ul.sublist {
margin:	0px 0px 0px 0px;
padding: 5px 5px 0px 0px;
}

ul{
margin:	0px 0px 0px 00px;
padding: 0px 0px 0px 0px;
}

}
</style>
</head>
<body topmargin=&quot;0&quot; leftmargin=&quot;0&quot;>
<ul>
  <li>AAAAAAAA</li>
  <li>AAAAAAAA
    <ul class=&quot;sublist&quot;>
  		 <li>AAAAAAAA</li>
 		 <li>AAAAAAAA</li>
  		 <li>AAAAAAAA</li>
 		 <li>AAAAAAAA</li>
  		<li>AAAAAAAA</li>
	</ul>
  </li>
  <li>AAAAAAAA</li>
  <li>AAAAAAAA</li>
  <li>AAAAAAAA</li>
</ul>
</body>
</html>

why are the 2 browsers spacing the list items differently and how can i get them to look identical between browsers?

PS I'm not using standard bullets, or the standard list-style-image because IE 6 places bullets at the top of the list item text, and Netscape 7 places it at the bottom of the list item text. I don't believe there is a way to change that.

Thank you in advance,

TheInsider
 
Try not specifying the font as verdana 12px for a start - that should make it a bit closer.
 
You might think this rather defeatist, but is there any reason your page has to be exactly the same, down to the last pixel, for every browser? There are much better ways for you to spend your time and bandwidth than pursuing this (probably futile) dream. Concentrate on content and let the browser worry about the finer points of presentation.

-- Chris Hunt
 
Thanks for your replies. I do need to specify the font and size in this case, otherwise it will not match my current scheme. I think that ChrisHunt is right in that it is a futile effort.

TheInsider
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top