Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Style first post only?

You could apply the style you want for only the first li to every li, then use the + selector to modify it for all li following another li (in effect letting you style only the first one, although it’s annoying that you may have to cancel styles).

li {
font-weight: bold; }
li + li {
font-weight: normal; }

should make just the first li bold. This I think works on every browser, even IE6.

The http://developer.mozilla.org/en/docs/CSS::first-child rule is of course the proper thing to do, but (if I recall correctly) doesn’t work for IE6. (This is what I would do … but I generally have no mercy for IE6 users anyway.)

Skip to toolbar