WordPress.org

Ready to get started?Download WordPress

Forums

Having different image behind page content on each page (3 posts)

  1. jhultquist14
    Member
    Posted 1 year ago #

    Hi all. I'm pretty new to wp and am building a child site using the twenty twelve theme. i have figured out how to do most of the changes that i want but i can't figure out how to have a different image behind the content on different pages. not the background image, i know how to change that, but the body background.

    i have this code in my css file

    body .site {

    background-image:url('main_background.jpg');
    padding: 0px;
    margin-top: 0px;
    margin-bottom: 0px;
    box-shadow: 0 0px 0px rgba(0, 0, 0, 0);
    }
    which shows that image on all pages but i only want that on the home page and different image on all the rest. All of my pages are static info.

    i know there are probably 3 different ways to do it but i keep getting stuck!

    Any help would be much appreciated,
    Josh

  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    You can use the unique home page class generated in the body tag to target just the home page:

    body.home .site { ... }
  3. jhultquist14
    Member
    Posted 1 year ago #

    thanks for the reply!

Topic Closed

This topic has been closed to new replies.

About this Topic