html5 - Bootstrap 3 navbar layout -
i'm beginner , started learn bootstrap please me noob question of mine. have problem layout in navbar. wanted navigation area on right , user information , picture. wanted layout like.
so far i've done is:
<nav class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">logo</a> </div> <div class="row"> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav navbar-right"> <li><a href="#">home</a></li> <li><a href="#about">about</a></li> </ul> </div><!--/.nav-collapse --> </div> </div> </nav>
i've tried nesting containers , added rows when browser collapses, alignment destroyed. can please me? i've been doing hours now.
here answer :)
<!doctype html> <html lang="en"> <head> <title>bootstrap case</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> <style> .test{ text-align: center; } .top_margin{ margin-top:10px; } </style> </head> <body> <nav class="navbar navbar-inverse"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand top_margin" href="#">websitename</a> </div> <ul class="nav navbar-nav pull-right"> <li class=" test"><a href="#">username <br> home | page 2</a></li> <li class="top_margin"><a href="#"><span class="glyphicon glyphicon-user"></span> sign up</a></li> </ul> <ul class="nav navbar-nav navbar-right"> </ul> </div> </nav> </body> </html>
Comments
Post a Comment