How to change background color only for post/page?

Posted in: Newspaper
Post count: 34

Hello,

I see there is an option to change the background color in Theme Panel but that change to the entire website. How do I change background only for single post and page?

Post count: 20685

Hi,

The background setting will apply on the whole website. There is no option to set a background only for specific pages or posts. When setting a background through the theme panel some classes will be applied to make the website boxed, it would be hard to replicate that for particular pages.
On pages, with the tagDiv composer you can set background colors or images for the rows for example
https://www.screencast.com/t/uniivqFv6X
You could try with custom code based on page ID, maybe something like this
https://www.screencast.com/t/oAMORoVH

.page-id-16558 .td-container-wrap {
width: 1164px;
}
@media (max-width: 1180px) {

.page-id-16558 .td-container-wrap {
width: 100%;
}}
body.page-id-16558 {
background-color: red;
}

But this is not tested properly, you could give it a try if you want to or modify the code further. Use the browser inspector to identify the elements and classes on the page
https://forum.tagdiv.com/create-custom-code-using-the-browsers-inspector/

Thanks

Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.