I am trying to add a white background to just the body and header text on my blog, so that I can add a background image behind the whole site.

I know I need to create a div that sits behind the body and header, however I'm a beginner with CSS so could do with a few pointers if possible.

Blog address is www.astridkearneyblog.com

Any help would be greatly received!


closed as off-topic by gmazzap, Chip Bennett, s_ha_dum, tfrommen, brasofilo Oct 1 '13 at 21:45

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions should be specific to WordPress within defined scope (merely happening in its context, such as generic PHP/JS/HTML/CSS, is insufficient). Might be better asked at Stack Overflow or other appropriate site of Stack Exchange network." – gmazzap, Chip Bennett, s_ha_dum, tfrommen, brasofilo
If this question can be reworded to fit the rules in the help center, please edit the question.


Easiest Solution would be to create a new css rule that simply changes the background color of an element to white i.e:

   background-color: #ffffff;

Then just add class="white-background" to the elements you want to have a white background. Just remember an HTML element can have multiple classes inside a single class="" attribute just add the classes separated by spaces.

if you add this class and the background doesn't behave you can add !important to the CSS rule as follows:

   background-color: #ffffff !important;

You'll want to use z-index to place the elements above and below each other

Check out Mozilla and W3Schools for an intro to CSS, and if you're really serious about getting into making websites, Team Treehouse has great curriculums

If you didn't make the theme you're using, check out the theme options page. It might have an option to add a background image

Not the answer you're looking for? Browse other questions tagged or ask your own question.