Jump to content

Set background image on homepage only

Recommended Posts

Add to Home > Design > Custom CSS

@media screen and (min-width:641px) {
.homepage {
    background-image: url(https://beaverhero.com/wp-content/uploads/2019/10/boost-generatepress.png);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}
}

Replace your image url.

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
1 minute ago, LivAils said:

Hi that's great for getting rid of it on mobile, thanks.

When it does appear, I also wanted it to appear on the homepage only, so delete it from all other pages. How do I do this?

that code for only desktop & tablet (min-width:641px)

that code for only homepage (.homepage)

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
2 minutes ago, LivAils said:

Ah i see thanks. Yes it is not showing on the other pages but it is still showing when I click on each thumbnail (on the homepage). How do I remove it from these posts?

Difficult. Thinking.....

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 6 months later...
9 hours ago, laurafongprosper said:

Hello I would like to use the background image only on my homepage and not on the entire website.

http://laurafongprosper.com

Can somebody please help me ?

Add to Home > Design > Custom CSS

.homepage div#canvas {
    background-image: url(https://beaverhero.com/wp-content/uploads/2019/10/boost-generatepress.png);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
15 hours ago, laurafongprosper said:

 

try

body.homepage:not(.index-page-open) div#canvas {
    background-image: url(https://beaverhero.com/wp-content/uploads/2019/10/boost-generatepress.png);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 2 weeks later...
  • 2 years later...

Hello! I'm trying to get this code to work and am having no luck . . . I'm in 7.0, the website is 

http://www.elisepreiss.com/

And I'm getting a double background on the home page, and the background on the menu pages. I'd like it just once, on the home page only. How did I mess up? Ha!Thank you!

 

//bg image on home page only//
body.homepage:not(.index-page-open) div#canvas {
    background-image: url(https://images.squarespace-cdn.com/content/v1/51b10c6de4b0236194eaaf0c/1668646772871-UWPWFXA1B0XJC4L1EMT1/paysages-de-la-chalosse.jpg);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.