Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

3 column grid navbar bootstrap

I am trying to create a 3 column grid navbar, I have tried using the columns that are built into bootstrap but have no success.

The first column needs to have a max-width of 100px, but can be fluid if the browser is re-sized

the second column needs to be the fill the gap between the 1st and 2nd column and is also fluid to respond if the browser is re-sized.

The third column needs to have a max-width of 200px, but can be fluid if the browser is re-sized

I am unable to get the columns inline with each other, heres my Fiddle: http://jsfiddle.net/Xsfvw/7/

<!--Bootstrap Approach-->
<div class="container-fluid">
    <div class="row">
        <div class="col-xs-8 col-sm-3 border">Logo</div>
        <div class="col-xs-2 col-sm-6 border">Nav</div>
        <div class="col-xs-2 col-sm-3 border">Right</div>
    </div>
</div>
<!--Standard CSS Approach-->
<div class="container-fluid">
    <div class="row">
        <div class="nalogo">Logo</div>
        <div class="nanav">Nav</div>
        <div class="naright">right</div>
    </div>
</div>

CSS:

.border {
    border: 2px solid #ff0000;
    z-index: 1020;
    height: 50px;
    margin-bottom: 30px;
}
.nalogo {
    width:100px;
    height:50px;
    background-color:#ff0000;
    border: 1px solid #000;
    float: left;
}
.nanav {
    width:100%;
    height:50px;
    background-color:#00ff00;
    border: 1px solid #000;
    margin:0 auto !important;
}
.naright {
    display: inline-block;
    width:200px;
    height:50px;
    background-color:#0000ff;
    border: 1px solid #000;
    float: right;
}

Here is what i am trying to replicate:

navbar

like image 984
JT1 Avatar asked Jun 27 '14 20:06

JT1


1 Answers

Bootstrap supports hiding and showing grid tiles based on the width of the screen. Consider using visible-*-block as a way to address your issue. Please consider the following fiddle:

http://jsfiddle.net/Xsfvw/10/

It uses the following design pattern:

<div class="container-fluid">
  <div class="row">
      <div class="col-xs-2 visible-xs-block border">Nav</div>
      <div class="col-xs-8 visible-xs-block border">Logo XS</div>
      <div class="col-xs-2 visible-xs-block border">Right</div>
      <div class="col-sm-3 visible-sm-block visible-md-block border">Logo SM</div>
      <div class="col-sm-6 visible-sm-block visible-md-block border">Nav </div>
      <div class="col-sm-3 visible-sm-block visible-md-block border">Right</div>
  </div>
</div>
like image 185
Nicholas Blasgen Avatar answered Sep 23 '22 23:09

Nicholas Blasgen