Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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;
}
Comment | File | Size | Author |
---|---|---|---|
#7 | change-background.7.patch | 555 bytes | hitvika_verma |
#7 | after-change-background-color.png | 623.56 KB | hitvika_verma |
#7 | before-change-background-color.png | 348.04 KB | hitvika_verma |
Comments
Comment #2
nevets CreditAttribution: nevets commentedGiven 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?
Comment #3
xiaomo CreditAttribution: xiaomo commentedThank 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.
Comment #4
xiaomo CreditAttribution: xiaomo commentedI 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.
Comment #5
saurabh.dhariwal CreditAttribution: saurabh.dhariwal at AddWeb Solution Pvt. Ltd. commentedAs 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.
In body default set background-color white set, so remove that property.
Thanks!
Comment #6
CatsFromStonehenge CreditAttribution: CatsFromStonehenge commentedI 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.
Comment #7
hitvika_verma CreditAttribution: hitvika_verma commentedComment #8
hitvika_verma CreditAttribution: hitvika_verma commented