Twitter Bootstrap 3: How to get vertical navigation?

It seems to be supported in v2.3.2 as a class.nav-stacked

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

Is there a way to do this in the version 3.0.0?

+4
source share
2 answers

By default, a class navin Bootstrap 3 has a vertical layout (no borders) and also .nav-pillsstill supports a stackable layout, but if you want an “old” look, you can always simply add styles from a previous version of your CSS (plus a small fix):

.nav-stacked > li {
  float: none;
}
.nav-stacked > li > a {
  margin-right: 0;
}
.nav-tabs.nav-stacked {
  border-bottom: 0;
}
/*Fix to remove space between li's*/
.nav-tabs.nav-stacked>li+li {
    margin-top: 0;
}
.nav-tabs.nav-stacked > li > a {
  border: 1px solid #ddd;
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  border-radius: 0;
}
.nav-tabs.nav-stacked > li:first-child > a {
  -webkit-border-top-right-radius: 4px;
  -moz-border-radius-topright: 4px;
  border-top-right-radius: 4px;
  -webkit-border-top-left-radius: 4px;
  -moz-border-radius-topleft: 4px;
  border-top-left-radius: 4px;
}
.nav-tabs.nav-stacked > li:last-child > a {
  -webkit-border-bottom-right-radius: 4px;
  -moz-border-radius-bottomright: 4px;
  border-bottom-right-radius: 4px;
  -webkit-border-bottom-left-radius: 4px;
  -moz-border-radius-bottomleft: 4px;
  border-bottom-left-radius: 4px;
}
.nav-tabs.nav-stacked > li > a:hover,
.nav-tabs.nav-stacked > li > a:focus {
  border-color: #ddd;
  z-index: 2;
}
+5
source

bootstrap 3.0 - nav-stacked -class. , css :

.nav-stacked > li {
  float: none;
}

.nav-stacked > li + li {
  margin-top: 2px;
  margin-left: 0;
}
0

All Articles