patriciasmh
patriciasmh

Reputation: 350

How to create button in navbar with icon-bars with bootstrap?

I am new to bootstrap. I want to create a button in navbar that has three icon-bars.

Here is my code:

<button type="button" class="navbar-btn btn-default pull-right">        
    <span class="icon-bar"></span>  
    <span class="icon-bar"></span>  
    <span class="icon-bar"></span>    
</button>

Above creates a button but it's very small and has no icon-bars. What am I doing wrong?

Upvotes: 0

Views: 2226

Answers (1)

Camden Narzt
Camden Narzt

Reputation: 2003

Add the navbar-toggle class and an id, then in your css target that id and make the display:block;

something like:

html:

<button type="button" class="navbar-btn btn-default pull-right navbar-toggle" id="hamburgerIcon">        
  <span class="icon-bar"></span>  
  <span class="icon-bar"></span>  
  <span class="icon-bar"></span>    
</button>

css:

#hamburgerIcon{
  display:block;
}

Upvotes: 1

Related Questions