# Navbar help?-covering content

**URL:** <https://forum.freecodecamp.org/t/navbar-help-covering-content/131411>\
**Category:** General\
**Created:** [June 24, 2017, 6:43pm UTC](https://forum.freecodecamp.org/t/navbar-help-covering-content/131411 "2017-06-24T18:43:31Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![dms909](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dms909/32/58761_2.png) [@dms909](https://forum.freecodecamp.org/u/dms909)\
**Post date:** [June 24, 2017, 6:43pm UTC](https://forum.freecodecamp.org/t/navbar-help-covering-content/131411/1 "2017-06-24T18:43:31Z")

</div>

When minimize my page, my navbar covers content, any help?

 ![](https://global.discourse-cdn.com/freecodecamp/original/3X/3/a/3a86dfa54ea36b08408d6f57244fa4a6875cc60d.jpg)

> **[jwLPRL](https://codepen.io/dms909/pen/jwLPRL)**
>
> ...

---

<div class="post-metadata">

**Author:** ![liberaltech](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/liberaltech/32/160402_2.png) [@liberaltech](https://forum.freecodecamp.org/u/liberaltech)\
**Post date:** [June 24, 2017, 7:32pm UTC](https://forum.freecodecamp.org/t/navbar-help-covering-content/131411/2 "2017-06-24T19:32:13Z")

</div>

If you’re wanting it to collapse then you need to include all the bootstrap collapsible class.

---

<div class="post-metadata">

**Author:** ![liberaltech](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/liberaltech/32/160402_2.png) [@liberaltech](https://forum.freecodecamp.org/u/liberaltech)\
**Post date:** [June 24, 2017, 7:36pm UTC](https://forum.freecodecamp.org/t/navbar-help-covering-content/131411/3 "2017-06-24T19:36:01Z")

</div>

Here’s the bootstrap example:

```auto
<nav class="navbar navbar-default">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">Brand</a>
    </div>

```

---

<div class="post-metadata">

**Author:** ![MarioAleixo](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/marioaleixo/32/69139_2.png) [@MarioAleixo](https://forum.freecodecamp.org/u/MarioAleixo)\
**Post date:** [June 24, 2017, 7:55pm UTC](https://forum.freecodecamp.org/t/navbar-help-covering-content/131411/4 "2017-06-24T19:55:42Z")

</div>

To actually make a menu collapsible when the browser window is under a certain width, you should use the following Bootstrap classes: `.collapse` and `.navbar-collapse`. So, wrapping your links in a div with the aforementioned classes should hide the menu.

```
<div class="collapse navbar-collapse">
  <ul class="nav navbar-nav navbar-right">
    <li><a href="#">Home</a></li>
    <li><a href="#abt">About</a></li>
    <li><a href="#pex">Projects</a></li>
    <li><a href="#ctc">Contact</a></li>
  </ul>
</div>

```

Now you’ll have hidden the menu, but I’m almost certain you’ll want a way to show/hide the menu when you need to. Take a look at the following link which should teach you what you need and give you a better understanding of how navbars in Bootstrap work: [https://getbootstrap.com/components/#navbar](https://getbootstrap.com/components/#navbar).

---

<div class="post-metadata">

**Author:** ![dms909](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dms909/32/58761_2.png) [@dms909](https://forum.freecodecamp.org/u/dms909)\
**Post date:** [June 24, 2017, 8:53pm UTC](https://forum.freecodecamp.org/t/navbar-help-covering-content/131411/5 "2017-06-24T20:53:09Z")

</div>

I used this code, but when I click the button it does nothing.

---

<div class="post-metadata">

**Author:** ![r1chard5mith](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/r1chard5mith/32/160542_2.png) [@r1chard5mith](https://forum.freecodecamp.org/u/r1chard5mith)\
**Post date:** [June 24, 2017, 10:06pm UTC](https://forum.freecodecamp.org/t/navbar-help-covering-content/131411/6 "2017-06-24T22:06:51Z")

</div>

Are you including the bootstrap javascript on your page? The collapsed menus won’t work otherwise. Bootstrap also requires jQuery by default.

---

<div class="post-metadata">

**Author:** ![dms909](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dms909/32/58761_2.png) [@dms909](https://forum.freecodecamp.org/u/dms909)\
**Post date:** [June 25, 2017, 1:37pm UTC](https://forum.freecodecamp.org/t/navbar-help-covering-content/131411/7 "2017-06-25T13:37:58Z")

</div>

[https://codepen.io/dms909/pen/jwLPRL](https://codepen.io/dms909/pen/jwLPRL) Currently this is my code.

---

<div class="post-metadata">

**Author:** ![tehDrew](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/tehdrew/32/55285_2.png) [@tehDrew](https://forum.freecodecamp.org/u/tehDrew)\
**Post date:** [June 25, 2017, 5:34pm UTC](https://forum.freecodecamp.org/t/navbar-help-covering-content/131411/8 "2017-06-25T17:34:07Z")

</div>

I think the issue might be that you’re using v3 of Bootstrap, which I’m not sure (I’ve only read the documentation for v4 navbars) support what you want in the way you’re using it.

Maybe try changing your JQuery/javascript settings to use v4?

---

<div class="post-metadata">

**Author:** ![liberaltech](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/liberaltech/32/160402_2.png) [@liberaltech](https://forum.freecodecamp.org/u/liberaltech)\
**Post date:** [June 25, 2017, 7:03pm UTC](https://forum.freecodecamp.org/t/navbar-help-covering-content/131411/9 "2017-06-25T19:03:55Z")

</div>

Replace your `nav` with this:

```auto
<nav class="navbar navbar-inverse">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">Dylan Smith</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
        <li><a href="#">Home</a></li>
        <li><a href="#abt">About</a></li>
        <li><a href="#pex">Projects</a></li>
        <li><a href="#ctc">Contact</a></li>
      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>

```

---

<div class="post-metadata">

**Author:** ![dms909](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dms909/32/58761_2.png) [@dms909](https://forum.freecodecamp.org/u/dms909)\
**Post date:** [June 25, 2017, 10:19pm UTC](https://forum.freecodecamp.org/t/navbar-help-covering-content/131411/10 "2017-06-25T22:19:26Z")

</div>

Thanks man! That fixed it!

---

<div class="post-metadata">

**Author:** ![dms909](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/dms909/32/58761_2.png) [@dms909](https://forum.freecodecamp.org/u/dms909)\
**Post date:** [June 25, 2017, 10:26pm UTC](https://forum.freecodecamp.org/t/navbar-help-covering-content/131411/11 "2017-06-25T22:26:53Z")

</div>

I have one more question, how would I change the side of the links from the left to the right?

---

<div class="post-metadata">

**Author:** ![liberaltech](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/liberaltech/32/160402_2.png) [@liberaltech](https://forum.freecodecamp.org/u/liberaltech)\
**Post date:** [June 26, 2017, 1:28am UTC](https://forum.freecodecamp.org/t/navbar-help-covering-content/131411/12 "2017-06-26T01:28:46Z")

</div>

Add the `text-right` class to the `<ul></ul>` tag that wraps your links.

```auto
<ul class="nav navbar-nav text-right">
...
...
...
<\ul>

```

Hopefully this is what you’re looking for.

Edit:

You could also do this same thing using CSS.

```auto
li{
    text-align: right;
}

Or using a class.

.navbar-nav{
    text-align: right;
}

```

---

<div class="post-metadata">

**Author:** ![veroac](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/veroac/32/58844_2.png) [@veroac](https://forum.freecodecamp.org/u/veroac)\
**Post date:** [July 19, 2017, 9:08am UTC](https://forum.freecodecamp.org/t/navbar-help-covering-content/131411/13 "2017-07-19T09:08:26Z")

</div>

And least I have found de solution for my problem 😀 reading this post. thanks!

---

<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:** [January 16, 2021, 5:51pm UTC](https://forum.freecodecamp.org/t/navbar-help-covering-content/131411/14 "2021-01-16T17:51:50Z")

</div>

Closed on January 16, 2021, 5:51pm UTC


