Twitter-Bootstrap-2 logo image on top of navbar
Can someone suggest how I can place a logo image on the top of the navbar? My markup:
<body>
<a href="index.html"> <img src="images/57x57x300.jpg"></a>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
It is not working as the 57x57x300.jpg is shown below the navbar.
You have to also add the "navbar-brand" class to your image a
container, also you have to include it inside the .navbar-inner
container, like so:
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="navbar-brand" href="index.html"> <img src="images/57x57x300.jpg"></a>
</div>
</div>
</div>
Overwrite the brand class, either in the bootstrap.css or a new CSS file, as below -
.brand
{
background: url(images/logo.png) no-repeat left center;
height: 20px;
width: 100px;
}
and your html should look like -
<div class="container-fluid">
<a class="brand" href="index.html"></a>
</div>