Jump to content

Sticky section

Go to solution Solved by tuanphan,

Recommended Posts

  • 2 weeks later...
On 3/3/2023 at 7:48 PM, NGM said:

@tuanphanit looks great on mobile and most desktop browser screen sizes. Is there a way to avoid the gaps on tablet and some screen and zoom sizes?

IMG_2669.PNG

IMG_6573.PNG

use this

[data-section-id="63e6637613db3f494e7aa702"] {
    position: sticky;
    position: -webkit-sticky;
    top: 70px;
    z-index: 999999;
}
/* tablet */
@media screen and (max-width:1024px) and (min-width:768px) {
[data-section-id="63fe4c0f075efc4020c6faf4"] {
    top: 82px !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
  • 1 year later...
On 3/6/2024 at 8:20 PM, websm said:

Hello! How should I code the section to have it sticky like here in the 2nd section  https://www.studiofounded.com/ ?

Looks like 1st section is not touched, but 2nd is scrolling with the 1st one along the way.

Thanks!

 

Try this code to Website > Website Tools > Custom CSS

[data-section-id="65d8a8c923d22574773eba43"] {
    position: sticky !important;
    position: -webkit-sticky !important;
    top: 0 !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.