Changing background color or other basic style attributes per page?
-
I’m trying to figure out the easiest way to change the background color and other basic style attributes per page in WordPress.
Context: I know some css. I don’t know php. I know only basic HTML (like link tags and bold for fonts)
I thought that one way to do this would be make several page templates for my child theme and then – somehow – refer to each template in the style.css to change just the parts I want to change from the default.
So after some searching I did some cut and paste and made a page template php file that is this:
————
[code moderated - please follow the forum rules for posting code]-------------
thinking that I had created a class that I could then code into the style.css. Somehow. The template shows up fine in the page drop-down menu. But I can't figure out how to get it to differ from the default through style.css edits.
1. If I am correct in my approach here and the php file above is ok:
Could someone give me the piece of code I would need in the style.css file to change/override the default background color or image for this template? I don't seem to be able to figure out the syntax. Also, if there is a particular place that this should go or not go in the stylesheet, I would appreciate knowing that too.
2. If I didn't do the php file correctly:
Could someone advise me as to how to change it (and also answer #1 if you're so inclined)
3. OR is there a whole other simpler way to do this that doesn't involve page templates at all?
(for example: I saw a reference somewhere to something along the lines of .page-id=1 followed by specific css attributes but I can't quite figure out the specific code (a correct code example example, say for the background color, would be awesome).
I feel like I should have this figured out already. But clearly I'm missing something rather huge amidst the grand-canyon-size gaps in my actual knowledge.
- The topic ‘Changing background color or other basic style attributes per page?’ is closed to new replies.