Saturday, 24 May

Cranky CSS:

I’ve been working on something where there’s a need to mark up some content in the form of an unordered list — for contextual purposes. The page contains more than one list, and I’d like to apply separate styles to a number of them. At first I tried to do this using the form: .class>li but IE doesn’t support rules with the selector in that form.

Using li.class is another option, but not a great one — especially where, as in this case, long lists are concerned. It works, but only when each of your tags contain the actual class declatarion — not very efficient. Inserting all that seemingly unecessary code is time-consuming, and can increase page sizes where a great deal of it is involved.

If I’ve missed something, correct me, but I’m left wondering what went wrong on the drawing board with this one. The form li.class implies 2 objectives: to endow coders with a method for producing more than a single style for H1, list, and P type elements; and to eliminate the recurring need to declare the class of these elements (thereby achieving a third objective by reducing page weight).

update: I’ve put my foot in my mouth. Tomas kindly points out that the .class li structure is what I was searching for. However did I miss that? *whistle*

* * *

Why not use “.class li”?

Tomas | May 24, 2003 09:37 PM
* * *

Heh! Thanks Tomas ;)

Ryan | May 24, 2003 11:55 PM
* * *

Anytime ;-)

The difference between “.class li” and “.class>li” is that the first means “any li-tag beneath an element of class ‘class’”, whereas the second means “any li-tag *immedately* beneath an element of class ‘class’”. And, like you observed, IE doesn’t support the latter, yet.

Tomas | May 25, 2003 09:56 PM
* * *

There is no great genius without some touch of madness. by casino online

casino | December 8, 2004 11:46 AM
* * *

poker me up

poker me up | January 1, 2005 01:24 AM
* * *









    forget!




All content copyright © 2002 of Ryan Carter