Change background on one page

Home Forums Modern Change background on one page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #22054
    Theodore
    Participant

    Change background on one page

    Resolved

    Hey there! Have you noticed this support service is provided FREE of charge?
    If you like the speed and accuracy of resolutions, please consider supporting me with a small donation. Thank you

    Consider a donation →

    Hi, I’d like to change the background on one page. This is what I’ve tried to put in my Customize >> Additional CSS:

    .page-id-35 #post-35 body.custom-background{
    	background-color: #505061 !important;
    }

    If I just put:

    body.custom-background{
    	background-color: #505061 !important;
    }

    Then it changes for all my pages, but I only want to change it for post 35. Do you know how I can do that?
    Thank you!

    • This topic was modified 2 weeks, 5 days ago by  Theodore. Reason: Added a question
    • This topic was modified 2 weeks, 5 days ago by  Oliver Juhas. Reason: Formatting code
    #22060
    Oliver Juhas
    Keymaster

    Hi Theodore,

    Please try using your web browser code inspector to determine the CSS for your theme modifications. This custom CSS should be sufficient enough:

    .page-id-35 {
    	background-color: #505061;
    }

    Best regards,

    Oliver Juhas
    WebMan Design

    #22062
    Theodore
    Participant

    Hi,
    Thank you, Oliver Juhas, for your support. I tried using the code inspector before and the code I sent above is where it got me. This is what made it work for me:

    .page-id-35 {
    	background-color: #505061 !important;
    }

    Without the !important, it seems to not work.

    Thank you again,
    Theodore

    #22063
    Oliver Juhas
    Keymaster

    Hi Theodore,

    In that case you can try rising the CSS selector specificity instead of using !important, such as:

    body.page-id-35 {
    	background-color: #505061;
    }

    or

    .page.page-id-35 {
    	background-color: #505061;
    }

    Best regards,

    Oliver Juhas
    WebMan Design

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