Jump to content

"sticky" section on scroll?

Go to solution Solved by tuanphan,

Recommended Posts

URL: https://www.jconstantino.net/hear2

Hi all. I am trying to add some custom styling/functionality to the first line of text on the page above ("for a list of tracks currently..."). I would like to add a background color block to that text that spans the width of the content (the distance from the logo on the top left to the end of the nav on the top right), but I would also like this new section to replace the nav bar when someone scrolls down, so that once the nav bar disappears, the new section with the link sticks to the top of the screen. I hope this makes sense, and if so, can someone assist with this? Thank you very much!

Link to comment
  • Replies 2
  • Views 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Solution

You can use this code to Website > Website Tools (under Not Linked) > Custom CSS

[data-section-id="65bbf3d589d59858a28b7071"] {
    position: sticky !important;
    position: -webkit-sticky !important;
    top: 0 !important;
    z-index: 999999 !important;
}
[data-section-id="65bbf3d589d59858a28b7071"] .section-background {
    background-color: #fff !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

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.