4

I have a bootstrap nav and I need to avoid stacking of it on smaller viewports so that it stays horizontal and does not stack.

Here is a example

HTML:

<div class="menuBar">
    <ul class="nav nav-justified">
        <li>
            <a href="#" class="menuItem">
                <i class="glyphicon glyphicon-asterisk"></i>
            </a>
        </li>
        <li>
            <a href="#" class="menuItem">
                <i class="glyphicon glyphicon-asterisk"></i>
            </a>
        </li>
        <li>
            <a href="#" class="menuItem">
                <i class="glyphicon glyphicon-asterisk"></i>
            </a>
        </li>
    </ul>
</div>

CSS:

.menuBar ul {
    text-align: justify;
}
.menuBar ul li a {
    display: inline-block;
}
.menuItem {
    font-size: 24px;
}

Extended version: http://jsfiddle.net/m5k93rwo/

What is the best way to do that? I suspect some play with data-toggle but, unfortunately, I'm not experienced enough to be sure how make it working well

Christina
  • 32,538
  • 17
  • 76
  • 118
nagafono
  • 57
  • 8

1 Answers1

6

Add this css after all your other css:

  .nav-justified > li {
    display: table-cell;
    width: 1%;
  }
  .nav-justified > li > a {
    margin-bottom: 0;
  }
Christina
  • 32,538
  • 17
  • 76
  • 118