Edgar Axe
Edgar Axe

Reputation: 130

Bootstrap navbar?

I would like to know why my website navbar in mobile won't close and open like I want. When the user clicks on those 3 bars, it should close and open in mobile view, but it just won't work. Here is the code for the navbar:

Here is my website. Just resize it, and you will see that it just stays there and won't close like I want it to.

Here is the website: http://edgaraxe.net/

<div class = "navbar navbar-default navbar-static-top" >
			<div class = "container">
			<!--Navigation -->
		<div class="navbar-header">
			<a class="navbar-brand">Edgar Axelsson</a>
        <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>
			<div>
			<div class "collapse navbar-collapse navHeaderCollapse">
			<ul class = "nav navbar-nav navbar-right">

Upvotes: 1

Views: 68

Answers (1)

tarun713
tarun713

Reputation: 2187

Try using id on your data-target. Try

<button class="navbar-toggle" data-toggle="collapse" data-target="#testnavbar" aria-expanded="true">

on your button and

<div class="collapse in" "collapse="" navbar-collapse="" navheadercollapse"="" id="testnavbar" aria-expanded="true">

on your div.

Also, note that your div does not have an = on your class - that seems to be a typo, so the div line should look like:

<div class="collapse navbar-collapse navHeaderCollapse" id="testnavbar">

Upvotes: 3

Related Questions