I received some amazing help this morning and was able to add a background image to my homepage, but now as I’m adding pages, I’ve noticed that it is repeating on all other pages as well.
I’d like the background image to apply only to the homepage. Can someone please provide me with a fix?
This is the code I’m using on ColorBlock theme:
body {
background: url(“url_image_path”) no-repeat !important;
background-size: cover !important;
}
To apply the background image only to the homepage and not on other pages, you can modify your code to add a specific class to the body tag of your homepage. Here’s an example:
On your homepage, add a class to the body tag like this:
html <body class="homepage">
Then, modify your CSS code to only apply the background image to the body tag with the “homepage” class, like this: