Jump to content

how to modify the opacity and position of an image used to create parallax effect

Recommended Posts

Hey,

I am using this code to add an image to a page of my website. i wanted to make it change the background opacity and control the size and pozition but I can't find a way to do that. This is my current code:

 

[data-section-id="65a17e4f7a733c1afbbca853"]{
  .section-background{
    &::after {
    /*creating the element*/      
      content: "";
      width:100%;
      height:100%;
      position: absolute;
      
      
      /*adding the image*/  
      background-image:url(https://images.squarespace-cdn.com/content/v1/64bf900d35d1b51f0d7fc93a/329ec592-3468-4888-85f3-3861f9e77b7c/background.png?format=2500w);
      background-repeat:no-repeat;

 

I tried adding this to the code as an addition to the one above - not working.

 background-repeat:no-repeat;
      background-attachment: fixed;
      background-position: center;
       background-size: cover;

 

If anyone can help please let me know!

 

Edited by rocsi
spelling mistake
Link to comment
  • Replies 1
  • Views 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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.