Forum Moderators: open

Message Too Old, No Replies

Spacing between list items

Should I faint or just run mad?

         

vmcknight

3:31 am on Sep 16, 2002 (gmt 0)

10+ Year Member



Darn it, I could SWEAR I read something a few weeks ago, perhaps here, about using CSS to alter the spacing of list items. But I can't find a thing by searching or in my references.

Could some kind soul point me to the correct thread, or tell me if I just dreamed it?

Purple Martin

4:00 am on Sep 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just searched WW for you, and I think you'll like these two topics:

topic 1 [webmasterworld.com]
topic 2 [webmasterworld.com]

bobriggs

4:09 am on Sep 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you're talking about line spacing:

UL {line-height: 20px;}

(choose your own height)

works, but I have to keep it in an @import for some reason because NN4 doesn't like it very much.

tedster

6:11 am on Sep 16, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you want to alter the space between line items (but not within them) you can create a rule like this

li {
margin-top:8px;
margin-bottom:8px;
}

You need to address BOTH margin-top and margin-bottom, or else the margin collapsing rules will always render the larger of the two spaces in between the list items.

When I didn't grok this, I got very frustrated. I had the margins down to 0 or even negative numbers and the screen still showed a big ugly gap.

[edited by: tedster at 8:59 am (utc) on Sep. 17, 2002]

vmcknight

8:47 pm on Sep 16, 2002 (gmt 0)

10+ Year Member



Thank you all very much - I'll sensibly bookmark this thread. Several nice options to play with now...