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.
By sundern on
Anyone had luck changing the background image in D8 to a fixed background image file ?
I looked at themes/theme-name/css/style.css
body {
line-height: 1.5;
font-size: 87.5%;
word-wrap: break-word;
margin: 0;
padding: 0;
border: 0;
outline: 0;
background-image: url('../images/main-bg1.png');
}
This is not working.. not sure what else can I do ?
Comments
=-=
after editing the css file did you clear drupal cache?
Did you utilize your browsers inspector tool to see if the additional CSS was being pulled into the page?
Clearing cache is a daily business
I am clearing cache every 2 mins.. to see the change. I found the solution to the background problem. All you have to do is to modify the css/html.css. body { } section.
=-=
actually, you should not be editing the files. You should be overriding the CSS using your own custom.css file defined last in your subtheme.info file. This to protect changes if/when a theme is updated later and to keep all your changes in a singular file.
Interesting..thanks for the tip
I knew that from a general perspective but not specific to themes. How did you know this custom.css file ? Is it mentioned somewhere in the drupal8 documentation ? If I were to intentionally change the theme to test out some other new theme and revert back to my old theme, would all the changes done on my old theme will be gone for good like in css/ templates/ js/ directories etc. ?
=-=
mentioned specifically. No idea. If yes, in the theme docs. However, it's a benefit to cascading style sheets (CSS) in drupal or otherwise.
no.