javascript - Bootstrap 3 navigation list items hover issue -


i have tryed example:

html

<div class="container">     <nav class="navbar navbar-default" role="navigation">       <!-- brand , toggle grouped better mobile display -->       <div class="navbar-header">         <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">           <span class="sr-only">toggle navigation</span>           <span class="icon-bar"></span>           <span class="icon-bar"></span>           <span class="icon-bar"></span>         </button>       </div>        <!-- collect nav links, forms, , other content toggling -->       <div class="collapse navbar-collapse navbar-ex1-collapse">         <ul class="nav navbar-nav">           <li><a href="#">link</a></li>           <li><a href="#">link</a></li>           <li><a href="#">link</a></li>           <li><a href="#">link</a></li>           <li class="dropdown">             <a href="#" class="dropdown-toggle" data-toggle="dropdown">dropdown <b class="caret"></b></a>             <ul class="dropdown-menu">               <li><a href="#">action</a></li>               <li><a href="#">another action</a></li>               <li><a href="#">something else here</a></li>               <li><a href="#">separated link</a></li>               <li><a href="#">one more separated link</a></li>             </ul>           </li>         </ul>       </div><!-- /.navbar-collapse -->     </nav> <h1>home</h1> 

css

@media (min-width: 768px) {     .navbar .navbar-nav {         display: inline-block;         float: none;     }      .navbar .navbar-collapse {         text-align: center;     } } 

http://jsfiddle.net/bdd9u/3/

from page: center content in responsive bootstrap navbar

and wanted add hover effect nav list items so:

http://jsfiddle.net/bdd9u/560/

but @ bottom has height , hover effect cant take enough space. if resize screen mobile size can see header height reduced 5px bottom. how repair issue?

it looks display: inline-block adding space after navbar elements.

you can set fixed height navbar.

@media (min-width: 768px) {    .navbar .navbar-nav {      display: inline-block;      float: none;      height: 45px; /* add */    }  }

updated jsfiddle


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -