2

When trying to adjust to Bootstrap 3, I have encountered the following problem.

When I click on the button named F, I would like Home and Not Home to show up, but it does not at the moment.

This is the video I am learning from.

<div class= "navbar navbar-inverse navbar-static-top">
    <div class="container">
        <a class= "navbar-brand">Jackdh</a>
        <button class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse"> F 
        </button>
        <div class ="collapse navbar-collapse navHeaderCollapse">
            <ul class = "nav navbar-nav navbar-right">
                <li><a href="#">Home</a></li>
                <li><a href="#">Not Home</a></li>
            </ul>   
        </div>
    </div>
</div>
honk
  • 9,137
  • 11
  • 75
  • 83
Jack
  • 2,891
  • 11
  • 48
  • 65

3 Answers3

8

I'm pretty sure that you simply forgot to add bootstrap.js and also jquery. With that included, everything works for me.

Marcel Gwerder
  • 8,353
  • 5
  • 35
  • 60
2

@op (original poster)

Marcel's answer gave me a clue so I checked my script tag

<script src="bootstrap.min.js"></script>

I forgot to add the bootstrap javascript folder "js/"

With this script tag everything works fine.

<script src="js/bootstrap.min.js"></script>

@ Marcel - I couldn't vote up your answer due to lack of reputaion!

deemyBoy
  • 65
  • 10
0

You forgot to add navbar-header div after container, Try this one !

` Brand

        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
    </div>`