CSS code for adding background images to pages

  • Unknown's avatar

    I would like to have different background images on my pages, can you send me the CSS code to make this possible? Thanks in advance.

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    You can do this in a similar way to how we added the unique header to the services page. Again, this uses a random image from your media library and is targeted at your services page. You will need choose your background images wisely as you will see with this example. It is sometimes hard to find an image that works well as a background behind text.

    .page-id-87 .site-content-contain {
      background: url('https://bellenesia.files.wordpress.com/2017/08/manhattan-407703.jpg') no-repeat scroll center top / cover;
    }
  • Unknown's avatar

    Wow, it worked. You guys rock! Thank you, thank you, thank you.

  • Unknown's avatar

    Hi,

    For future reference, when you look at your blog and press F12, there is this arrow sign on top (next to ‘Elements’). When you press that once, you can select a element on the blog to inspect and it jumps to the styles, classes, divs and so on that are set with that element. F12 gives lots of cool information, you can even change something in the style sheet that F12 is showing, for example a background-color, to see how it looks without it affecting the actual style sheet. It’s something like a sandbox.

    It also helps to figure out for what to look for (for example divs or classes) in the actual style sheet.

  • Unknown's avatar

    For what @kimdebruijn is suggesting, take a look at our support document on How to Find Your Theme’s CSS, which has some brief screencasts to get you started using it. It makes working with CSS much easier.

  • Unknown's avatar

    Thank you kimdebruijn and thesacredpath, this information is very helpful. Take care

  • Unknown's avatar

    You are welcome, and you too!

  • The topic ‘CSS code for adding background images to pages’ is closed to new replies.