Bootstrap: Navbar Header

    I don't see too many examples in bootstrap with something like this but what it is incase you don't know is a banner of some kind above the navbar. In fact I don't see too many sites with this kind of structure lately and from my experience I can understand why not. If you're going for responsiveness it's difficult to create since you are always checking to see if you have enough space on both sides for whatever it is your trying to display in between. From the sites that I have seen that do have this can really pull it off and use something similar to bootstrap's affix feature.
    When I first started using bootstrap which was sometime around 3.0, I was using the navbar-brand to hook into the styles already written for me. However since bootstrap 3.1  navbar-brand has now been given a height where before I was using the image's auto or attributes to adjust the height. I was able to give my header an even amount of padding around my header which might not be what the nabar-brand was meant for but it worked very well for me. So since the update change I went back and correct my little hack by substituting it with break tags.
    What's great about my new solution is that I'm able to get all the same structures without creating any of my own styles. Not that I want to avoid creating custom styles but I like to get the most out of my css libraries. In all the solutions that I found some custom css required. The only css I really use is for the navbar, The header itself is very responsive and shows the use of icons/text as well as images. I didn't use the bootstrap affix feature wanted to keep things simple.

Solution:http://plnkr.co/edit/972rq7ysFZDAC0qYIorw?p=preview
<div class="container">
      <br/>
        <div class="media pull-left col-centered ">
          <img class="media-object pull-left" src="..." alt="..." height="45" width="45"/>
          <div class="media-body">
            <h4 class="media-heading"><a class="" href="#">Company Name</a></h4>
              <small>Company Message</small>
          </div>
        </div>
        <ul class="nav pull-right">
          <li><a href="#login"><i class="fa fa-sign-in fa-fw"></i>Login</a></li>
        </ul>
    </div>
    <br/>
    <nav class="navbar navbar-default text-center" role="navigation">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".layout-nav">
        <i class="fa fa-list fa-lg"></i>
      </button>
      <div class="navbar-collapse collapse layout-nav">
        <ul class="nav navbar-nav">
          <li><a href="#">Home</a></li>
          <li><a href="#about">About</a></li>
          <li><a href="#contact">Contact</a></li>
        </ul>
      </div>
    </nav>


Resources
how to use background image in twitter boostrap navbar? - Stack Overflow
- jsFiddle demo by handtrix - Note that with IE9  the image does not work.
http://codepen.io/davidcochran/pen/Dihnl
http://www.bootply.com/96188
http://jsfiddle.net/NK6nh/3/ - haha!

Popular posts from this blog

Aspetcore: NLog with Postgresql

Mongodb Cheatsheet

Installing Windows on Acer chromebook 15 cb3-532