You must remove the navbar-fixed-top class, otherwise the navbar will remain at the top of the page where you want the logo.
If you want to place the logo inside navbar:
Navbar height (set in @navbarHeight LESS variable) is 40px by default. Your logo must be inside, or you need to make navbar first.
Then use brand class:
<div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <a href="/" class="brand"><img alt="" src="/logo.gif" /></a> </div> </div> </div>
If your logo is higher than 20px , you also need to fix the style sheets.
If you do it in LESS:
.navbar .brand { @elementHeight: 32px; padding: ((@navbarHeight - @elementHeight) / 2 - 2) 20px ((@navbarHeight - @elementHeight) / 2 + 2); }
@elementHeight should be set to the height of your image.
Gap calculation is taken from Twitter Bootstrap LESS - https://github.com/twitter/bootstrap/blob/v2.0.4/less/navbar.less#L51-52
Alternatively, you can compute fill values โโyourself and use pure CSS.
This works for Twitter Bootstrap version 2.0.x, should also work in version 2.1, but the calculation of add-ons has changed a bit: https://github.com/twitter/bootstrap/blob/v2.1.0/less/navbar.less#L50
jana4u Sep 10 2018-12-12T00: 00Z
source share