Support Forum
Hi again Simple Press team
Just another question
When a user creates a topic, they generally ask a question which shows up at the top and then other people answer the first person's question. Is there a way I can target the first post inside a topic to have it styled differently to all the subsequent posts? I want to emphasize the first post in the topic as that is the primary focus.This is with css ofcourse.
Your help as always is appreciated.
hey Shane,
I'm fairly sure you have a child theme set up, at least if you don't yet I've posted the instructions in your other topic.
You can target the CSS within the first post using the class 'spFirstPost'.
For example, using it like this will make the background of the first post in every topic red:
#spMainContainer .spFirstPost { background: red; }
You can use it more precisely by using 'spFirstPost' before targeting elements within the post, for example this will make the post content background within the first post in every topic red:
#spMainContainer .spFirstPost .spPostContentSection .spPostContent { background: red; }
Assuming here that you know basic CSS you can change that 'background: red;' for whatever you'd like that's applicable to the element you're editing. As long as 'spFirstPost' is used any subsequent post specific rules will only apply to the first post.
Hope that helps!
1 Guest(s)