html - Building a responsive navbar with bootstrap -
i building website using bootstrap 3. problem navbar on webpage shows next brand div, floated left. navbar doesn't have enough space when using mobile phone access webpage , have scroll in menu.
html
<div class="navbar navbar-fixed-top navbar-default" role="navigation"> <div class="container"> <button class="navbar-toggle" data-target=".navbar-responsive-collapse" data-toggle="collapse" type="button"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="index.html">future logo</a> <div class="navbar-collapse navbar-responsive-collapse collapse"> <ul class="nav navbar-nav"> <li class="active"><a href="index.html"><span class="glyphicon glyphicon-home"></span> domu</a></li> <li><a href="obsahmp.html">obsah mp</a></li> <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">responzivní webdesign<strong class="caret"></strong></a> <ul class="dropdown-menu"> <li><a href="responzivniwebdesign.html">co vlastně je?</a></li> <li><a href="webovarozvrzeni.html">webová rozvržení</a></li> <li><a href="">tvorba responzivního webu</a></li> <li class="divider"></li> <li class="dropdown-header">css frameworky</li> <li><a href="#">co, jak proč?</a></li> <li><a href="#">twitter bootstrap</a></li> </ul><!-- end dropdown-menu--> </li><!-- end dropdown--> <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">použité komponenty<strong class="caret"></strong></a> <ul class="dropdown-menu"> <li><a href="navbar.html">navbar</a></li> <li><a href="dropdown.html">dropdown</a></li> <li><a href="carousel.html">carousel</a></li> <li class="divider"></li> <li class="dropdown-header">dropdown-header</li> <li><a href="#">subsection</a></li> <li><a href="#">subsection</a></li> </ul><!-- end dropdown-menu--> </li><!-- end dropdown--> </ul><!--end nav--> </div><!-- end navbar-collapse--> </div> <!-- end container--> </div> <!-- end navbar-->
you can check navbar here: www.tomas-nosek.moxo.cz. rezise browser window , see problem have.
try this,
add <div class="visible-xs clearfix"></div>
end of <a class="navbar-brand" href="index.html">future logo</a>
this clear floating css on small devices,
<div class="navbar navbar-fixed-top navbar-default" role="navigation"> <div class="container"> <button class="navbar-toggle" data-target=".navbar-responsive-collapse" data-toggle="collapse" type="button"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="index.html">future logo</a> <div class="visible-xs clearfix"></div> <div class="navbar-collapse navbar-responsive-collapse collapse"> <ul class="nav navbar-nav"> <li class="active"><a href="index.html"><span class="glyphicon glyphicon-home"></span> domu</a></li> <li><a href="obsahmp.html">obsah mp</a></li> <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">responzivní webdesign<strong class="caret"></strong></a> <ul class="dropdown-menu"> <li><a href="responzivniwebdesign.html">co vlastně je?</a></li> <li><a href="webovarozvrzeni.html">webová rozvržení</a></li> <li><a href="">tvorba responzivního webu</a></li> <li class="divider"></li> <li class="dropdown-header">css frameworky</li> <li><a href="#">co, jak proč?</a></li> <li><a href="#">twitter bootstrap</a></li> </ul><!-- end dropdown-menu--> </li><!-- end dropdown--> <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">použité komponenty<strong class="caret"></strong></a> <ul class="dropdown-menu"> <li><a href="navbar.html">navbar</a></li> <li><a href="dropdown.html">dropdown</a></li> <li><a href="carousel.html">carousel</a></li> <li class="divider"></li> <li class="dropdown-header">dropdown-header</li> <li><a href="#">subsection</a></li> <li><a href="#">subsection</a></li> </ul><!-- end dropdown-menu--> </li><!-- end dropdown--> </ul><!--end nav--> </div><!-- end navbar-collapse--> </div> <!-- end container--> </div> <!-- end navbar-->
Comments
Post a Comment