Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter Bootstrap like vertical navigation bar on side

I am new to bootstrap, and having a problem in creating navigation bar like bootstrap has.I invested lot of time trying it but unable to figure out. What I want is like

enter image description here

This is what i found here

<div class="span3 bs-docs-sidebar">
<ul class="nav nav-list bs-docs-sidenav affix">
  <li class="active"><a href="#dropdowns"><i class="icon-chevron-right"></i> Dropdowns</a></li>
  <li class=""><a href="#buttonGroups"><i class="icon-chevron-right"></i> Button groups</a></li>
  <li><a href="#buttonDropdowns"><i class="icon-chevron-right"></i> Button dropdowns</a></li>
  <li><a href="#navs"><i class="icon-chevron-right"></i> Navs</a></li>
  <li><a href="#navbar"><i class="icon-chevron-right"></i> Navbar</a></li>
  <li><a href="#breadcrumbs"><i class="icon-chevron-right"></i> Breadcrumbs</a></li>
  <li><a href="#pagination"><i class="icon-chevron-right"></i> Pagination</a></li>
  <li><a href="#labels-badges"><i class="icon-chevron-right"></i> Labels and badges</a></li>
  <li><a href="#typography"><i class="icon-chevron-right"></i> Typography</a></li>
  <li><a href="#thumbnails"><i class="icon-chevron-right"></i> Thumbnails</a></li>
  <li><a href="#alerts"><i class="icon-chevron-right"></i> Alerts</a></li>
  <li><a href="#progress"><i class="icon-chevron-right"></i> Progress bars</a></li>
  <li><a href="#media"><i class="icon-chevron-right"></i> Media object</a></li>
  <li><a href="#misc"><i class="icon-chevron-right"></i> Misc</a></li>
</ul>

like image 730
vaibhav1312 Avatar asked Jun 15 '13 14:06

vaibhav1312


2 Answers

Copy the css of bs-sidebar from docs.css of twitter bootstrap; add additional CSS that is separately defined at the bottom of the same file as below:

CSS

.bs-sidebar .nav > .active > ul {
    display: block;
    margin-bottom: 8px;
}

HTML

<div class="bs-sidebar affix">
    <ul class="nav bs-sidenav">
        <li class="active"><a href="#">NAV1</a>
            <ul class="nav">
                <li><a href="#">1</a></li>
                <li><a href="#">2</a></li>
            </ul>
        </li>
        <li><a href="#">NAV2</a></li>
    </ul>
</div>
like image 141
Krishna Murthy Avatar answered Oct 11 '22 22:10

Krishna Murthy


Did u check bootstrap nav bar -> stackable section, here?

<ul class="nav nav-tabs nav-stacked">
  ...
</ul>

Looks like the same as you've asked... tried this?

like image 37
sk8terboi87 ツ Avatar answered Oct 11 '22 22:10

sk8terboi87 ツ