html - Navbar menu dropdown not working (won't drop down when clicked) -


when on mobile or when resize browser navbar dropdown menu not dropping down when clicked. have put navbar code here elaborating issue. in advance help!

<nav class="navbar navbar-default navbar-fixed-top">   <div class="container-fluid">     <div class="navbar-header">       <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="mynavbar">         <span class="icon-bar"></span>         <span class="icon-bar"></span>         <span class="icon-bar"></span>       </button>     </div>     <div class="collapse navbar-collapse" id="mynavbar">     <ul class="nav navbar-nav navbar-right">       <li><a href="#home">home</a></li>       <li><a href="#about">about</a></li>       <li><a href="#portfolio">portfolio</a></li>       <li><a href="#contact">contact</a></li>     </ul>   </div>  </div> </nav> 

bro have missed # in data-target attribute how works.

change line

<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="mynavbar"> 

by

<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#mynavbar"> 

check working demo here!


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -