html - duplicating github's topbar behavior with a bootstrap navbar? -
github's bar @ top i'm attempting duplicate using bootstraps navbar class (https://github.com/).
notice how bar extends fill entire browser window, while core elements stay in place in fixed column? that's i'm attempting figure out.
i have following code.
<body> <div class="container"> <div class="row"> <div class="span12"> <img src="/img/logo_sml.png"> </div> </div> </div> <div class="navbar"> <div class="navbar-inner"> <a class="brand" href="#">home</a> </div> </div>
my thinking was, if close main container
, place navbar
, have fill entire length of browser. worked planned, when add things navbar
appear way on left side of page (as expected).
so! thought start new container
put menu items, having appear in central column should.
wrapping menu element:
<body> <div class="container"> <div class="row"> <div class="span12"> <img src="/img/logo_sml.png"> </div> </div> </div> <div class="navbar"> <div class="navbar-inner"> <div class="container"> <div class="span2"> <a class="brand" href="#">home</a> </div> </div> </div> </div>
refreshed page, and... didn't work. there way extend "tails" of bootstrap navbar
while keeping content in main container
?
here's result adding in contatiner
class. elements sit way on left hand of browser.
it because css has property:
.navbar .container { width: auto; }
if put css property has
.navbar .container { width: 940px; }
it should work expected.
you can see used code in jsfiddle , the final result in full screen.
Comments
Post a Comment