News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Is it possible to change the formatting of just the first post in a topic?

Started by confuseamuse, July 17, 2018, 12:15:48 AM

Previous topic - Next topic

confuseamuse

I know about changing the style of windowbg in CSS, but it also changes the first post on every page. What would be the best way to give only the first post in a topic a different style, leaving the replies uniform in design?

SychO

Why not use :first-child or :first-of-type property, would definitely work with also a special ID for that one page
Checkout My Themes:
-

Potato  •  Ackerman  •  SunRise  •  NightBreeze

Gwenwyfar

:first-child would select the first post in every page. You'd probably need to add a class or id on the first post through the template and select that.
"It is impossible to communicate with one that does not wish to communicate"

confuseamuse

Quote from: Gwenwyfar on July 17, 2018, 10:05:57 AM
:first-child would select the first post in every page. You'd probably need to add a class or id on the first post through the template and select that.

I figured it out after actually thinking about it for two seconds. Thanks anyway.

Advertisement: