Jump to content

Five: CSS for sticky/fixed navigation bar?

Recommended Posts

  • 1 month later...
  • Replies 5
  • Created
  • Last Reply

I did manage to find a fix for this, albeit a bootlegged version. Try inserting the following bit of code under Custom CSS. Note: I also added a solid black border to my navigation bar. If you do not want the border, simply delete the: border-bottom: 2px solid black;

Since this is specific to my site, you may need to play around with some of the numbers to make it fit to your site. Let me know if you have any questions.


#navigation-top {
 width: 100%;
 padding: 4px;
 position: fixed;
 z-index: 99999;
 border-bottom: 2px solid black;
}

#site-title {
 padding: 35px;
}

@media only screen and (min-device-width: 320px)
and (max-device-width : 480px) {
 #navigation-top {
   position: absolute;
 }
}

Link to comment

Hi antonia! thanks for the reply. I also have the same problem.. and I use the five template and want to get the navigation fixed on the top..

just tried this code your provided but nothing happened.. my bad is mvdtrading.com maybe you can take a look to it. thanks!

Link to comment

I took a look at your site. You are using a different header/navigation format than I use, which is why the code isn't doing anything for you.

Unfortunately, I always have to play around with my code. It's a trial/error process for me. Since I can't actually play around with your site, I'm probably not able to be that helpful.

I believe in the format you are using for your template, the element is called page-header-wrapper. So you could try to insert this and see what happens:

page-header-wrapper {

width: 100%;
padding: 4px;
position: fixed;
z-index: 99999;
}

Link to comment
  • 1 year later...

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.