[thelist] CSS lists line height

aardvark roselli at earthlink.net
Thu Aug 22 22:50:01 CDT 2002


> From: "rudy" <r937 at interlog.com>
[...]
> my way, you can easily distinguish spaced out lists versus "compact"
> lists (since there's no "compact" attribute on the UL tag any more)

no, but there is via CSS... not a direct attribute, but you could use
a class="compact" and style that class to do what you want... it's
just as sloppy as using the attribute...

> sure, you can start differentiating *which* LIs get the extra spacing,
> but that's a slippery slope, and before you know it, you have UL>LI or
> UL LI or whatever, or classes on the ULs and spans inside the
> <li>...</li>, to say nothing of spurious <br /> tags sometimes, for no
> apparent reason... or (gulp) divs...

holy crap, what weird exceptions and rules are you thinking about?

> then along comes yet another list where you want regular spacing in
> between list items, but since it's already been tweaked, now instead
> of another list class, or maybe in addition to, or was it an ID, you
> start monkeying with negative margins, hoping that some of them will
> be additive, depending on the cascade order, and whoa, what about the
> padding, i could use that instead...

ok, i don't have this problem... i think there are two factors that
can cause this to happen:

- a lack of consistency in design, which requires all sorts of
exceptions that manifest as hack-ish CSS...

- a lack of a solid plan or understanding of the spec, which can lead
to lots of bloat as you backtrack over old styles and forget
interactions and cascade...

> that way lies madness
>
> your style sheet becomes an incredible house of cards, to fall apart
> at the slightest tweak... don't laugh, i've seen it happen -- well,
> maybe only to me

one of my rules is that i try to use as few classes and ids on
elements as possible, ideally having only a couple (like an id for
the navbar, for instance)... it's kind of like my avoidance of
relying on <span> and <div>, for those both lead to sloppy
unstructured code...

but minimizing all sorts of classes, ids, and embedded styles helps
ensure my pages are more consistent, and also reduces my maintenance
hassle...

since i re-built my all-CSS (on XHTML) personal site, i rather enjoy
going in and updating the code by removing a class or id as i find a
new way to use a selector that actually enjoys some support..

> but it seems a lot of the questions on css-discuss are just like that,
> people painting themselves into corners
[...]

yeah, there's a lot of lack of forethought on some of those...

--
Read the evolt.org case study
Usability: The Site Speaks for Itself
http://amazon.com/exec/obidos/ASIN/1904151035/evoltorg02-20
ISBN: 1904151035





More information about the thelist mailing list