Forum Moderators: not2easy

Message Too Old, No Replies

Getting rid of the indents on lists

Can't seem to find the right CSS

         

MatthewHSE

3:22 pm on Dec 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

I've got a couple lists on my site where I want to eliminate the margin that gets inserted at the left of the <li>'s. But, I can't seem to find the correct CSS. I've tried setting the margin of <ul> to 0, then the margin of <li> to 0, and finally both margins to 0. With a strict doctype, IE eliminated the margin all right, but it also eliminated the bullets themselves. Mozilla showed absolutely no effect at all.

What I'm after is a list of items like what you get in IE when you just use <li>'s without nesting them in a <ul>. If IE were my only concern I'd just do that. But Mozilla renders it differently (almost certainly correctly) and I can't make it work like I wanted. Any ideas?

Thanks,

Matthew

choster

3:28 pm on Dec 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Short answer: try ul {margin-left:1em;padding-left:0} or ul {margin-left:1.25em;padding-left:0} depending on the typeface.

Long answer: yes, IE interprets list indentation differently from Gecko and Opera. [devedge.netscape.com...]

Unfortunately, there seems to be no way to control the distance from the bullet to the text of the list item itself, which is my usual complaint.

MatthewHSE

4:24 pm on Dec 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks, that did it!