Info
- 3 posts
- 2 voices
- Started 4 years ago by outchy
- Latest reply from outchy
- This topic is resolved
Style first post only?
-
- Posted 4 years ago #
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...
-
- Posted 4 years ago #
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.)
-
- Posted 4 years ago #
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
-
You must log in to post.