Jump to content

Jasper template - Keep Title & Navigation at Top when scrolling

Recommended Posts

  • Replies 4
  • Views 809
  • Created
  • Last Reply

It seems you solved with this code?

.header {
    position: fixed;
    left: 0;
    width: 100vw;
    z-index: 1000;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
}

I think you should edit to this

header.header {
    position: fixed;
    left: 0;
    width: 100vw;
    z-index: 1000;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
}

 

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
7 hours ago, LL-Studio said:

Thank you @tuanphan but I tried to copy your code and it doesn't work.

Both codes are the similar. However, in some templates, blog titles use the .header class. If you set position: fixed for .header, maybe it will fixed the blog title as well.

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

@tuanphan I solved it, the problem was that in the Jasper template the header doesn't have background color, so I used this code to add it:

header#header {
    background: #ff0000;
    margin: 0 auto;
    padding: 3vw 5vw;
}

 

and after I used this code to keep the header when scrolling:

 
header#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
}
div#content {
    margin-top: 8vw;
}

 

 

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.