I'm working on a custom theme which involves styling specific pages and nodes. At first, to target these specific nodes, I used the selector page-node-##, where ## is the node ID. But this was on my local machine, and when I exported these nodes, I found that the node IDs would be different on both the staging and production servers. Is it better to use the section-XX, selector instead?

I was wondering if there is a recommended CSS selector for this kind of use cases, where the CSS is applied on specific pages/nodes?


A good way to do this using context:

Under conditions select Path and input your path

then under Reactions select Theme HTML. Here you can select the class you wish to add to the body.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.