Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Wrapper depending on the background image (not on content)


Elise__

Question

Site URL: https://mandarin-violin-mjw7.squarespace.com/

Dear squarespace community, 

I would like a wrapper around my background image. I want it to depend on the background image, and not the content.

Password: elise

Many thanks!

This is the code I use now: 

/**** HOMEPAGE ****/
/* Section 1 */
/* Section 1 gradient */
section[data-section-id="60ef53636ebc0620d8effd57"]
.content-wrapper
{width:100%!important;
  background: linear-gradient(to right, rgb(216, 188, 171), rgba(0,0,0,0), rgba(0,0,0,0));
  z-index: 1;}
/* Header gradient */
.header-announcement-bar-wrapper.black,  header#header {
    background: linear-gradient(to right, rgb(216, 188, 171), rgba(0,0,0,0), rgba(0,0,0,0)) !important;
}
@media @mobile {
  /* Section 1 gradient */
section[data-section-id="60ef53636ebc0620d8effd57"]
.content-wrapper
{width:100%!important;
  background: linear-gradient(to right , rgb(216, 188, 171),rgba(0,0,0,0),rgba(0,0,0,0),rgba(0,0,0,0), rgb(216, 188, 171));
  z-index: 1;}
/* Header gradient */
.header-announcement-bar-wrapper.black,  header#header {
    background: linear-gradient(to right , rgb(216, 188, 171),rgba(0,0,0,0),rgba(0,0,0,0),rgba(0,0,0,0), rgb(216, 188, 171))!important;
}  
}

 

Link to comment

3 answers to this question

Recommended Posts

  • 0
18 hours ago, Elise__ said:

Site URL: https://mandarin-violin-mjw7.squarespace.com/

Dear squarespace community, 

I would like a wrapper around my background image. I want it to depend on the background image, and not the content.

Password: elise

Many thanks!

This is the code I use now: 

/**** HOMEPAGE ****/
/* Section 1 */
/* Section 1 gradient */
section[data-section-id="60ef53636ebc0620d8effd57"]
.content-wrapper
{width:100%!important;
  background: linear-gradient(to right, rgb(216, 188, 171), rgba(0,0,0,0), rgba(0,0,0,0));
  z-index: 1;}
/* Header gradient */
.header-announcement-bar-wrapper.black,  header#header {
    background: linear-gradient(to right, rgb(216, 188, 171), rgba(0,0,0,0), rgba(0,0,0,0)) !important;
}
@media @mobile {
  /* Section 1 gradient */
section[data-section-id="60ef53636ebc0620d8effd57"]
.content-wrapper
{width:100%!important;
  background: linear-gradient(to right , rgb(216, 188, 171),rgba(0,0,0,0),rgba(0,0,0,0),rgba(0,0,0,0), rgb(216, 188, 171));
  z-index: 1;}
/* Header gradient */
.header-announcement-bar-wrapper.black,  header#header {
    background: linear-gradient(to right , rgb(216, 188, 171),rgba(0,0,0,0),rgba(0,0,0,0),rgba(0,0,0,0), rgb(216, 188, 171))!important;
}  
}

 

try

/**** HOMEPAGE ****/
/* Section 1 */
/* Section 1 gradient */
section[data-section-id="60ef53636ebc0620d8effd57"]
.section-background .section-background-overlay
{width:100%!important;opacity: 1;
  background: linear-gradient(to right, rgb(216, 188, 171), rgba(0,0,0,0), rgba(0,0,0,0));
  z-index: 1;}
@media @mobile {
  /* Section 1 gradient */
section[data-section-id="60ef53636ebc0620d8effd57"]
.section-background .section-background-overlay
{width:100%!important;opacity: 1;
  background: linear-gradient(to right , rgb(216, 188, 171),rgba(0,0,0,0),rgba(0,0,0,0),rgba(0,0,0,0), rgb(216, 188, 171));
  z-index: 1;}

}

image.thumb.png.7fb0f452e9d876e056fcecd8b47c2980.png

Greeting, it's BaNgan from BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Youtube Gallery for Squarespace
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 0
Posted (edited)
On 7/21/2021 at 6:27 AM, bangank36 said:

try

/**** HOMEPAGE ****/
/* Section 1 */
/* Section 1 gradient */
section[data-section-id="60ef53636ebc0620d8effd57"]
.section-background .section-background-overlay
{width:100%!important;opacity: 1;
  background: linear-gradient(to right, rgb(216, 188, 171), rgba(0,0,0,0), rgba(0,0,0,0));
  z-index: 1;}
@media @mobile {
  /* Section 1 gradient */
section[data-section-id="60ef53636ebc0620d8effd57"]
.section-background .section-background-overlay
{width:100%!important;opacity: 1;
  background: linear-gradient(to right , rgb(216, 188, 171),rgba(0,0,0,0),rgba(0,0,0,0),rgba(0,0,0,0), rgb(216, 188, 171));
  z-index: 1;}

}

image.thumb.png.7fb0f452e9d876e056fcecd8b47c2980.png

Hi @bangank36, thank you for your reply. 

I implemented it, but I have a question

How do I manage to have the background overlay behind the text? As you can see some of the text is disappearing behind the overlay.

Thank you

Edited by Elise__
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...