Jump to content

How to add a fixed background image for a certain page only?

Recommended Posts

Hi, how to add a fixed background image for a certain page only? I've came up with this code but it doesn't work for certain collection. When pasted without the "collection" line, it works, however for all pages equally. How to make it work for a certain page only? Thank you.

#collection-COLLECTIONNUMBER
{

body::before {
  background-image: url('IMAGELINKHERE.JPG');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  content: '';
  height: 100%;
  opacity: 1;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  z-index: -10;
}

.page-section,
.page-section .section-background {
  background-color: transparent !important;
}

}

Link to comment
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You can add this code to Page Header

<style>
  body::before {
  background-image: url('IMAGELINKHERE.JPG');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  content: '';
  height: 100%;
  opacity: 1;
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  z-index: -10;
}

.page-section,
.page-section .section-background {
  background-color: transparent !important;
}
</style>

 

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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.