Skip to:
Content
Pages
Categories
Search
Top
Bottom

Style first post only?

  • Is there a way to style the text of only the first post for each topic? I know how to style every alternating post but I can’t figure out how to style just the first entry…

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.)

    I went with the first-child option and after a lot of tinkering, I finally got it working. To hell with IE6! Thanks so much for your help, fel64

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.