# Nav bar wont work in CSS

**URL:** <https://forum.freecodecamp.org/t/nav-bar-wont-work-in-css/358466>\
**Category:** General\
**Created:** [March 13, 2020, 12:53am UTC](https://forum.freecodecamp.org/t/nav-bar-wont-work-in-css/358466 "2020-03-13T00:53:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aliceburnham](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/aliceburnham/32/136975_2.png) [@aliceburnham](https://forum.freecodecamp.org/u/aliceburnham)\
**Post date:** [March 13, 2020, 12:53am UTC](https://forum.freecodecamp.org/t/nav-bar-wont-work-in-css/358466/1 "2020-03-13T00:53:41Z")

</div>

Hi everyone! My html is correct, the nav bar only works when CSS is not applied.

Here is what is causing the issue:  
.split {  
height: 100%;  
width: 50%;  
**position: fixed;**  
z-index: 1;  
top: 0;  
overflow-x: hidden;  
padding-top: 20px;  
}

When i remove position:fixed; the nav bar finally works! But then my site goes crazy.

 ![image](https://global.discourse-cdn.com/freecodecamp/original/3X/2/c/2cf0f255f07bac4126cc25913f63ec36d459c682.png)

(Its suppose to be contacts on one side and socials on the other side, this works well when the position is fixed but it causes my nav bar to become unclickable)

How can I fix this? If i need to do so with flexbox, then how? Thanks 🙂

FULL CODE: [https://codepen.io/aliceburnham/pen/yLNKJrG](https://codepen.io/aliceburnham/pen/yLNKJrG)

---

<div class="post-metadata">

**Author:** ![Imstupidpleasehelp](https://avatars.discourse-cdn.com/v4/letter/i/7ab992/32.png) [@Imstupidpleasehelp](https://forum.freecodecamp.org/u/Imstupidpleasehelp)\
**Post date:** [March 13, 2020, 12:57am UTC](https://forum.freecodecamp.org/t/nav-bar-wont-work-in-css/358466/2 "2020-03-13T00:57:39Z")

</div>

Try isolating your nav bar in it’s own div.

---

<div class="post-metadata">

**Author:** ![aliceburnham](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/aliceburnham/32/136975_2.png) [@aliceburnham](https://forum.freecodecamp.org/u/aliceburnham)\
**Post date:** [March 13, 2020, 12:58am UTC](https://forum.freecodecamp.org/t/nav-bar-wont-work-in-css/358466/3 "2020-03-13T00:58:40Z")

</div>

It already is in its own div ☹

---

<div class="post-metadata">

**Author:** ![Imstupidpleasehelp](https://avatars.discourse-cdn.com/v4/letter/i/7ab992/32.png) [@Imstupidpleasehelp](https://forum.freecodecamp.org/u/Imstupidpleasehelp)\
**Post date:** [March 13, 2020, 12:59am UTC](https://forum.freecodecamp.org/t/nav-bar-wont-work-in-css/358466/4 "2020-03-13T00:59:17Z")

</div>

Link your full code, on codepen or codesandbox

---

<div class="post-metadata">

**Author:** ![robertgroves](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/robertgroves/32/209852_2.png) [@robertgroves](https://forum.freecodecamp.org/u/robertgroves)\
**Post date:** [March 13, 2020, 1:00am UTC](https://forum.freecodecamp.org/t/nav-bar-wont-work-in-css/358466/5 "2020-03-13T01:00:44Z")

</div>

Hi @aliceburnham, welcome to the freeCodeCamp forum! 👋🏼

A link to your project might help others debug the issue. Or if you can replicate the issue in something like [codepen.io](http://codepen.io) and provide a link to it that would help us help you.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 1, 2021, 7:33pm UTC](https://forum.freecodecamp.org/t/nav-bar-wont-work-in-css/358466/7 "2021-06-01T19:33:07Z")

</div>

Closed on June 1, 2021, 7:33pm UTC


