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

Transparent Gradient Behind Header

Question

Site URL: https://grape-plum-jrlb.squarespace.com

I'm working with a difficult (busy) logo.  I'm trying to find code for a transparent gradient behind the header.  I've mocked it up in Illustrator to show what I'm looking for (attached).  Has anyone been successful using custom code for this?  I'm using the Grape Plum template.

 

Site password is: PreviewER

Screen Shot 2020-04-17 at 4.48.44 PM.png

Screen Shot 2020-04-17 at 4.48.56 PM.png

Share this post


Link to post

Recommended Posts

  • 0

Hi @tuanphan

I'm completely new to CSS editor. I'm looking to have a header gradient also.

I tried copying what you wrote above and pasted into the editor (...squarespace.com/config/editor) and hit save but there was no change to the site.

Being so new to this I know I'm doing something wrong. Are you able to help or is there a post I should read before doing anything?

I deleted the code and saved just in case.

Thank you

Dom

 

On 4/18/2020 at 10:52 AM, tuanphan said:

[data-section-id="5e3bc9210f963716337a1bb2"] .section-background:after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background-image: linear-gradient(to top, #182043, transparent);
}

 

 

Share this post


Link to post
  • 0

Thanks for the help with this and the different logos in headers.  Your solution was spot on there @tuanphan.

Attached are the screenshots of what I'm seeing and the code injection.  Can you provide any insight and what I might be doing wrong?

 

Screen Shot 2020-04-19 at 11.49.53 PM.png

Screen Shot 2020-04-19 at 11.50.11 PM.png

Share this post


Link to post
  • 0
2 hours ago, ArcherDesign said:

Hi @tuanphan

I'm completely new to CSS editor. I'm looking to have a header gradient also.

I tried copying what you wrote above and pasted into the editor (...squarespace.com/config/editor) and hit save but there was no change to the site.

Being so new to this I know I'm doing something wrong. Are you able to help or is there a post I should read before doing anything?

I deleted the code and saved just in case.

Thank you

Dom

Each site needs different code. Can you share link to your site?

 

1 hour ago, Justen said:

Thanks for the help with this and the different logos in headers.  Your solution was spot on there @tuanphan.

Attached are the screenshots of what I'm seeing and the code injection.  Can you provide any insight and what I might be doing wrong

Add to Home > Design > Custom CSS


You can send your question to my email to get faster answer.

How to Setup Password & Share URL - Free Templates - Free Code - CSS ID List

Share this post


Link to post
  • 0
Posted (edited)

@tuanphan Oh that window had scrolled down.  Attached is the full window.  However, do I need to replace with a different section id?  If so, I'm not sure how to find that.  That may be pretty basic but I'm trying to figure this out without having any coding background.  Thanks!

Screen Shot 2020-04-20 at 5.08.17 PM.png

Edited by Justen
Realized I didn't tag him.

Share this post


Link to post
  • 0
14 hours ago, Justen said:

@tuanphan Oh that window had scrolled down.  Attached is the full window.  However, do I need to replace with a different section id?  If so, I'm not sure how to find that.  That may be pretty basic but I'm trying to figure this out without having any coding background.  Thanks!

 

Remove above and use this

[data-section-id="5e3bc9210f963716337a1bb2"] .section-background:before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background-image: linear-gradient(to top,#182043,transparent);
}

 


You can send your question to my email to get faster answer.

How to Setup Password & Share URL - Free Templates - Free Code - CSS ID List

Share this post


Link to post
  • 0
Posted (edited)

Thanks @tuanphan, it is working now.  I'll need to make some tweaks to adjust how far down it goes so it doesn't cover the text.  Initially it was coming from the bottom up so I simply changed it from saying "background image to top" to say "background image to bottom" instead and that fixed it.  My first coding experience! 🙂
Can you tell me which elements control which parts of the gradient so I can just experiment and tweak to suit the exact finished product that looks good?  I see where the hex color is that one is easy.  But, What about:

-the overall size or height of the gradient so it gets to 0 before the hero text starts?
-how transparent the different points are on it, etc...?
-or, for future reference...what if I wanted it to start as one color and instead of fading to 0, the gradient is from one color to a different color?

Lastly, what do I need to do to be able to use that on other sites I'm working on?  I added it to another site and it didn't do anything?  I will probably use this technique on all of my sites.

Thanks for sticking with this.  You've been a tremendous help.

Screen Shot 2020-04-22 at 2.26.14 AM.png

Edited by Justen
Added a question about using it on a different site

Share this post


Link to post
  • 0

@tuanphan
I also noticed that it did not apply to the other pages on the Exterior Restorations site.  How can I choose to have it be applied to other pages?  For that site in particular, I would want it on every page expect the blog pages I believe.

Thanks.

Share this post


Link to post
  • 0
7 minutes ago, Justen said:

And if I want to have that apply to multiple pages on a site, can I insert all of the section ID's separated by comma?

@tuanphan

[data-section-id="id1"], [data-section-id="id2"], [data-section-id="id3"] {
  .section-background:before {
      content: "";
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 10000;
      background-image: linear-gradient(to top,#182043,transparent);
  }
}

 


You can send your question to my email to get faster answer.

How to Setup Password & Share URL - Free Templates - Free Code - CSS ID List

Share this post


Link to post
  • 0

Ok easy enough on the multiple ID's.  What about the overall height?  Right now it looks like it's the full height of the image.  I need to be able to shorten it to stop before the hero text in the middle.  I tried experimenting with the z-index value but that didn't seem to do it.  So, if I can shorten it either end or fade to 0 where I have the pink line in the screenshots attached, that will allow me to apply this to all of the other pages and it won't matter the height of the image on the secondary pages and it will be a consistent styling on all the pages. 
Thanks @tuanphan

header example-01.png

Share this post


Link to post
  • 0

Hi @tuanphan, I wanted to check in and see how I can control the overall height of the transparent gradient?  I would like it to sit behind the top nav, or slightly below the nav but not the entire hero image.  Roughly about the height of the pink line in the previous image.  If there is a way to control and experiment with it that would be good so I can use it at different sizes on different sites.

Thanks.

Share this post


Link to post
  • 0
27 minutes ago, Justen said:

Hi @tuanphan, I wanted to check in and see how I can control the overall height of the transparent gradient?  I would like it to sit behind the top nav, or slightly below the nav but not the entire hero image.  Roughly about the height of the pink line in the previous image.  If there is a way to control and experiment with it that would be good so I can use it at different sizes on different sites.

Thanks.

Too many notifications, missing your noti. I will check again tonight.


You can send your question to my email to get faster answer.

How to Setup Password & Share URL - Free Templates - Free Code - CSS ID List

Share this post


Link to post
  • 0

@tuanphan I played around with that site and tried to drop in the code but it did not work like the code you shared.  I tried inserting it in both places but no luck.  The code CSSGradient.io spits out is different than what you shared.  Is there any other way to experiment with the code you shared?  Particularly with the height of the gradient.  

Thanks for the help!

Share this post


Link to post
  • 0

Hi @tuanphan

I'm still trying to achieve the desired result of just displaying behind the nav.  I'm only needing the gradient transparency behind the top nav but was unable to get the CSSGradient.io 's code to work at all.  So, do you have any other ideas on a way to get this to appear either only behind the nav -or- a way to tweak the code you provided that did work over the entire hero image where I can adjust the fade points to accomplish the desired result of just showing behind the nav?

Thanks.

Share this post


Link to post
  • 0

Hi @tuanphan,

I hope you're doing well.  I'm sure you are really busy with notifications so I'm just gently calling out this thread.  The last piece to getting this site launched is being able to have a gradient that is just behind the top nav instead of the entire header section.  I will likely use this for most of my sites.  Is there a way to do that?

Thank you.

Share this post


Link to post
  • 0

try

[data-section-id="5e3bc9210f963716337a1bb2"] .section-background:before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background-image: linear-gradient(to bottom,#182043 0%, #182043 20%,transparent 50%);
}

 


You can send your question to my email to get faster answer.

How to Setup Password & Share URL - Free Templates - Free Code - CSS ID List

Share this post


Link to post
  • 0

Hi @tuanphan, That new code worked well.  It sits behind the header and allows me to adjust the values to accomplish exactly what I'm looking for.  Thank you!

When I just insert it with just the data-section-id for the homepage, it works great.  However, when I add in all of the other pages as you outlined above and Save, it tells me that there is a Syntax Error on line 1.  

Any idea what I'm doing wrong based on the screenshots? There are several section id's so I took a screenshot and scrolled.

Thanks.

Screen Shot 2020-05-21 at 1.53.24 AM.png

Screen Shot 2020-05-21 at 1.54.25 AM.png

Screen Shot 2020-05-21 at 1.54.32 AM.png

Share this post


Link to post
  • 0

Here it is.

 

[data-section-id="5e3bc9210f963716337a1bb2”], [data-section-id="5e22649f6810047965982a25”], [data-section-id="5e1af04c4ea7cf33bb5bca39"][data-section-id="5e16cc2389782e64aa5a3a50”], [data-section-id="5e1af0c43d0fa72e53dc2bbf"][data-section-id="5e1d3030b387c1091da2db61"][data-section-id="5e1d33c3595ea63874d61c7a”], [data-section-id="5e1d348558335752f830f707"][data-section-id="5e16b4cbabf5593c934d4460"][data-section-id="5e16b4e05c0f5f1d47c0801d"][data-section-id="5e16b4f5dc9fd475fcea69df"][data-section-id="5e1e5120f7c6f25343a289e2"][data-section-id="5e1599f01508dc7f6dc46fe4"][data-section-id="5e1e51e1408e262d95827740"][data-section-id="5e1e51e0408e262d95827616"][data-section-id="5e96b667be50c65fece7a21f"][data-section-id="5e96bc3b53790b6f9eeff160"][data-section-id="5e96bfc08f491f550d46079d"][data-section-id="5e96c17ad2c16745eb2e37e0"][data-section-id="5e96c42e40331b0020a1e3ae"][data-section-id="5e96c430b990fc5b6c542d5e"] .section-background:before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background-image: linear-gradient(to bottom,#182043 0%, #182043 7%,transparent 27%);
}

Share this post


Link to post

Create an account or sign in to comment

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


×
×
  • Create New...