# Sticky Navigation Not Working!

**URL:** <https://community.hubspot.com/t/sticky-navigation-not-working/78041>\
**Category:** CMS Development\
**Tags:** design-manager, css\
**Created:** [March 27, 2023, 3:25am UTC](https://community.hubspot.com/t/sticky-navigation-not-working/78041 "2023-03-27T03:25:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vorellana814](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/vorellana814/32/198037_2.png) [@vorellana814](https://community.hubspot.com/u/vorellana814)\
**Post date:** [March 27, 2023, 3:25am UTC](https://community.hubspot.com/t/sticky-navigation-not-working/78041/1 "2023-03-27T03:25:30Z")

</div>

Hey guys, I’m trying to create a sticky navigation with a hello bar on top. I want the hello bar to be out of view once you scroll and keep the navigation menu to the top. I did top: -32px so that the hello bar can be out of view. I tried it out in the module preview and it works but once it is on an actual page, position:sticky doesn’t work. Can someone please help? I’ve been stuck on this! Here is my HTML and CSS.

HTML:

\<div class=“nav-1”\>  
\<div class=“mission-control-login-div”\>  
\<div class=“hellobar”\>  
\<section class=“mission-control-login”\>  
\<a href=“”\>  
\<img src=‘{{ module\_asset\_url(“test.svg”) }}’ width=“20px” alt=“”/\>Testing  
\</a\>  
\</section\>  
\</div\>  
\</div\>  
\<div class=“nav-2”\>  
\<nav class=“menu menu–desktop” aria-label=“Main menu”\>  
\<section\>  
\<a href=“/”\>  
\<img src=“{{ site\_settings.logoSrc }}” alt=“” width=“150px”/\>  
\</a\>  
\</section\>  
\<ul class=“menu\_\_wrapper no-list”\>  
{{ menu\_items() }}\</ul\>  
\</nav\>  
\</div\>  
\</div\>

CSS:

.nav-1 {  
position: sticky;  
left: 0;  
top: -32px;  
right: 0;  
bottom: auto;  
z-index: 999;  
display: flex;  
max-width: 100%;  
margin-top: 0;  
padding-top: 0;  
flex-direction: column;  
justify-content: space-between;  
flex-wrap: nowrap;  
align-items: center;  
align-self: stretch;  
order: 0;  
flex: 0 auto;  
border-bottom: 1px solid #efefef;  
background-color: #fff;  
box-shadow: 0 4px 3px 0 rgba(0,0,0,.05);  
}

.mission-control-login-div {  
width: 100%;  
position: relative;  
}

.nav-2 {  
width: 100%;  
position: relative;  
}

---

<div class="post-metadata">

**Author:** ![piersg](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/piersg/32/99782_2.png) [@piersg](https://community.hubspot.com/u/piersg)\
**Post date:** [March 27, 2023, 9:28am UTC](https://community.hubspot.com/t/sticky-navigation-not-working/78041/2 "2023-03-27T09:28:11Z")

</div>

Can you link a page where you’re having this issue please? It’s much easier to diagnose and fix CSS when you can see and interact with it 🙂

---

<div class="post-metadata">

**Author:** ![ankitparmar09](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ankitparmar09/32/64399_2.png) [@ankitparmar09](https://community.hubspot.com/u/ankitparmar09)\
**Post date:** [March 27, 2023, 12:41pm UTC](https://community.hubspot.com/t/sticky-navigation-not-working/78041/3 "2023-03-27T12:41:32Z")

</div>

Use this following css it will be work

.nav-1 {

position: fixed;  
top: 0;  
width: 100%;  
z-index: 9999;

}
