Forum Moderators: not2easy

Message Too Old, No Replies

IE5 and horizontal lists

How to achieve margin or padding?

         

directrix

12:45 pm on Aug 14, 2004 (gmt 0)

10+ Year Member



I have a horizontally arranged list of navigation links. Sample html and css is below. My problem is that, no matter what I try, I can't get IE5.01 to render any space between the list elements. All is fine in IE6, Mozilla, Opera. Margin, padding, border: all do not work in IE 5.01.

Has anyone any CSS ideas? (I'd rather not use   if I can help it.)

<div class="m">
<ul>
<li><a href="http://domain1.com/">Link 1</a></li>
<li><a href="http://domain2.com/">Link 2</a></li>
</ul>
</div>

.m ul, .m li {display:inline; padding:0;}
.m ul {margin:0;}
.m li {margin:0 .5em 0 0; list-style:none;}

jam13

1:17 pm on Aug 14, 2004 (gmt 0)

10+ Year Member



Try setting the height of the list items to 0:

.m ul li {
display: inline;
padding: 0;
}
.m ul {
margin: 0;
}
.m li {
margin: 0.5em 0 0;
list-style: none;
height: 0;
}

Can't remember where I picked this up from, might have been here:

[css.maxdesign.com.au...]

but it works for us.

directrix

3:06 pm on Aug 14, 2004 (gmt 0)

10+ Year Member



Thank you. I would never have thought of that! And thanks for the great resource link.

createErrorMsg

3:34 pm on Aug 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can also try setting a margin-left or margin-right on the <a>nchor tag...

ul li a {
margin-left: 0.5em;
}