Hi, I was trying to add a white background to the content div through css. It was unsuccessful after the implementation, could you please point me to the right direction?

#content{

background-color:white;

}

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xiaomo created an issue. See original summary.

nevets’s picture

Given the default is white, I am unclear what you are trying to do but that should set the background color as you want. Did you refresh the page? Are you sure your css changes are loading?

xiaomo’s picture

Thank you for the quick reply, if I add a background image to the theme, the content becomes transparent. I wish the content background remain white no matter what the background image is.

xiaomo’s picture

I tried adding the code to #wrap #content as well, and it didn't work. However, it did work in chrome inspector. Can you please clearify.

saurabh.dhariwal’s picture

As per my understanding you need to set background-image in body and #content is transparent you want to set background-color in #content section.

Please check below CSS.

body {background-image:url("../images/Tulips.jpg"); }
#content { background-color:#fff; }

In body default set background-color white set, so remove that property.

Thanks!

CatsFromStonehenge’s picture

I think this is a bug. A page loses it's white background if it's the homepage (it has a grey background instead, and it's title is missing). This doesn't happen with other themes.

hitvika_verma’s picture

hitvika_verma’s picture

Status: Active » Needs review