Jump to content

CSS for a Background

Recommended Posts

Hello All,

I'm looking to customize the full background of my current template 'Horizon'. I added the following CSS to my Homepage, but I am not seeing the image appear:

#code {
    background-image: url(https://static1.squarespace.com/static/5e8e444d060d9c69061aab33/t/5eaf32a6437a4e57ef531b06/1588540071899/silent-season-background.png);
 }

I'm seeing that SquareSpace does not allow custom code on cover pages. Are they considering index.html/home a cover page?

Any help here is greatly appreciated.

Thanks,
David

Link to comment

Hi tuanphan,

I added the style tags as recommended and I couldn't get the background to show - 

<style>
#code {
    background-image: url(https://static1.squarespace.com/static/5e8e444d060d9c69061aab33/t/5eaf32a6437a4e57ef531b06/1588540071899/silent-season-background.png);
 }
</style>

Note: I am adding this code to the 'Custom CSS' area within the platform.

Website is https://www.silentseasonmusic.com

Thanks,
David

Link to comment
16 hours ago, David-Pappy-2020 said:

Can you screenshot the location that we can drop the css that you're speaking of?

I went to the Welcome/Home pages and advanced and dropped the code in each CSS section.

Still not seeing the background change.

Thanks,
David

are you sure this CSS class name is correct?

Quote

 #code

You want to add background image for whole page?

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
19 hours ago, David-Pappy-2020 said:

Hi tuanphan,

I referenced the sample CSS from an instructional video on SquareSpace. I'm not very experienced with CSS, as I am more involved with HTML only.

Yes, I would like to add this background image to the whole page. 

Thanks,

David

Add to Home > Design > Custom CSS

.homepage div#siteWrapper {
    background-image: url(https://cdn.pixabay.com/photo/2020/05/04/16/05/mckenzie-river-5129717__340.jpg);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
}

 

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
On 5/7/2020 at 4:36 AM, tuanphan said:

Add to Home > Design > Custom CSS


.homepage div#siteWrapper {
    background-image: url(https://cdn.pixabay.com/photo/2020/05/04/16/05/mckenzie-river-5129717__340.jpg);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
}

 

Hi tuanphan,

We're getting close here - www.silentseasonmusic.com

All I need now is to fix the picture size (Can we add dimensions to the size tag?), and make sure the image extends to the navigation and footer.

Thanks for all of the help!

David

Edited by David-Pappy-2020
Link to comment

Hi tuanphan,

Thanks for the additional code as it worked out perfectly!

How can I control the size of the background? As you can see it's zoomed in if you visit www.silentseasonmusic.com

Should I make a change to the original background file or include size percentages in my code?

Best,
David

Link to comment
1 hour ago, David-Pappy-2020 said:

Hi tuanphan,

Thanks for the additional code as it worked out perfectly!

How can I control the size of the background? As you can see it's zoomed in if you visit www.silentseasonmusic.com

Should I make a change to the original background file or include size percentages in my code?

Best,
David

background-size: cover;

background-size: contain;

background-size: auto;

you can try

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 year later...

Hi, I've tried the code above on my Squarespace site but this isn't working.

This is what I've put in:

.homepage div#siteWrapper {
    background-image: url(https://static1.squarespace.com/static/6116850124779a5aa1475b06/t/611a7731119a296f45de8abb/1629125207702/jacob-mejicanos-1ECUhpuUOlw-unsplash.jpg);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: fixed;
}

 

Are there any errors? Nothing is coming up

Link to comment
On 8/20/2021 at 3:43 PM, Isobel12345 said:

Hi, I've tried the code above on my Squarespace site but this isn't working.

This is what I've put in:

.homepage div#siteWrapper {
    background-image: url(https://static1.squarespace.com/static/6116850124779a5aa1475b06/t/611a7731119a296f45de8abb/1629125207702/jacob-mejicanos-1ECUhpuUOlw-unsplash.jpg);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: fixed;
}

 

Are there any errors? Nothing is coming up

Hi,

What is your site 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
On 8/25/2021 at 3:36 PM, Woodshack said:

Hi Tuanphan,

It's guitar-synthesizer-tnhz.squarespace.com, and password is guitar1.

Many thanks

Try this code

/* Site background image */
.section-background, .page-section {
    background: transparent !important;
}
body {
   background-image: url(https://cdn.pixabay.com/photo/2021/01/07/22/15/dandelion-5898546__340.jpg);
   background-size: cover;
   background-repeat: no-repeat;
   background-position: center center;
   background-color: transparent !important;
}

 

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
On 9/3/2021 at 10:12 PM, Chloe123 said:

The fixed position is working on desktop but this doesn't fix on mobile. Is there a way to make it fixed on mobile please?

Hi,

can you check password again?

Quote

guitar1.

 

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
  • 4 weeks later...

Hi @tuanphan, 

The fixed background works on Desktop, but when I look on my phone this doesn't work and the image is stretched and scrolling with other content.

Do you know if there's a way around this?

The link for the site is: dalmatian-dachshund-ba7x.squarespace.com
and password: guitar1

Thanks

Link to comment
On 8/25/2021 at 3:36 PM, Chloe123 said:

Hi Tuanphan,

It's guitar-synthesizer-tnhz.squarespace.com, and password is guitar1.

Many thanks

 

23 hours ago, Chloe123 said:

Hi @tuanphan, 

The fixed background works on Desktop, but when I look on my phone this doesn't work and the image is stretched and scrolling with other content.

Do you know if there's a way around this?

The link for the site is: dalmatian-dachshund-ba7x.squarespace.com
and password: guitar1

Thanks

Hi, Which page did you add the code?

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...

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.