Click here to Skip to main content
15,887,254 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm trying to make a horizontal sticky navigation bar on Squarespace, but it's not moving when I scroll.

What I have tried:

CSS
/*HORIZONTAL STICKY CONTENT NAV - BRINE (7.0)*/
#block-yui_3_17_2_1_1689246379568_22135 {
  background-color: #222021;
  box-shadow: 0 3px 20px rgba(0,0,0,0.08);
  min-height: 0;
  position: sticky;
  -webkit-position: sticky;
  top: 0;
  z-index: 999;
}

#block-yui_3_17_2_1_1689246379568_22135.Index-page-content {
  padding-top: 20px;
  padding-bottom: 20px;
}

#block-yui_3_17_2_1_1689246379568_22135 .html-block {
  padding-bottom: 0 !important;
  text-align: center;
}

#block-yui_3_17_2_1_1689246379568_22135 .html-block p {
  display: inline-block;
  margin: 0 20px;
}
Posted
Updated 15-Jul-23 2:11am
v2
Comments
Member 15627495 14-Jul-23 15:01pm    
with :
z-index:10; // use another display stack with your menu above others.
position:fixed; // fixed achieve to push out from main html code 'flow' elements,
top:10%; // top position in % / px / em
left:10%; // left position ....
Andre Oosthuizen 15-Jul-23 8:11am    
You need to post your HTML code as well as we cannot guess what your element structure is.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900