Search code examples
twitter-bootstrapnavbartwitter-bootstrap-2

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.


Solution

  • 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>