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'm looking for a way to change the background color (the dark gray part) to a background image, is it possible? Can it be done in the CSS file, or a better method? My html/css knowledge is limited, anyone can point me to the right direction would be really appreciated.
Thanks.
Comments
Comment #1
jeremycaldwell CreditAttribution: jeremycaldwell commentedSure you can change out the background color for another color or an image through CSS only. You'll need to create a local.css file in your theme's directory and add code similar to this.
That is how to load a different background color for the html element of the site. And here is how to load a background image for it.
Hope that helps!
Comment #2
ssace CreditAttribution: ssace commentedI tried this in my zen (sub theme) .css file. Background image doesn't show up.
I need some help on why this is. I tried different variations & cleared cache. Still doesn't show.
background: url(images/militaryback.pgn);
background-image: url(images/militaryback.pgn);
EDIT: Sorry, I just noticed I posted this in a different theme discussion. I would think the method would be the same though.
Comment #3
ssace CreditAttribution: ssace commentedFixed. My problem was due to .pgn image format. Once I changed to .gif, it worked. Not sure why .pgn file does not show up.
Comment #4
bchezem CreditAttribution: bchezem commentedcould be as simple as a typo.... try something.png. something.pgn is not a valid image format.
Comment #6
billy_comic CreditAttribution: billy_comic commentedI am having a problem inserting a background image. do I have to ad the html, above it or can it just be the {css}? It just goes white when I put it in.
my code.
body
{
margin: 0px;
font-family: helvetica, arial, sans-serif;
font-size: small;
background: url(./images/back.png);
}
can you help me?
Comment #7
nevets CreditAttribution: nevets commentedIf you use firefox you can use the net tab to see if the image loaded and if not the path it is trying to use.