Archived topic
CSS background-image
1 reply · Started by Theodore on July 24, 2018
Hi,
I am using the following style.css to display a background image for an individual page on my localhost xampp site:
.page-id-364 {
background-image: url(http://localhost:8080/minimum.com/wp-content/uploads/clouds_01.jpg);
background-size: cover;
background-repeat: no-repeat;
}
1. The background image is not displaying.
2. Using the Chrome Inspect to see the css. I notice a strike-through the style.css text for the image. (background-image: url(http://localhost:8080/minimum.com/wp-content/uploads/clouds_01.jpg);).
3. The background-size and backgroumd-repeat display without strike-through in the Chrome Inspect.
4. If I add a (background-color: blue;) to the style.css, the background becomes blue.
So, why isn't the background image displaying?
Thanks .. Ted
Hi there,
The code itself looks good so hard for us to tell why it isn't working without seeing it live unfortunately.
Just making sure you aren't adding the code to the theme's style.css?
It needs to be in child theme's style.css or one of these methods:
https://docs.generatepress.com/article/adding-css/