这取决于您是希望药片堆叠还是并排放置。您可以在这个工作的 JSFiddle中看到这两个选项。
堆叠的 HTML:
<section class="row-fluid">
<nav class="span2">
<ul class="side-nav nav nav-pills nav-stacked">
<li><a href="#"><i class="icon-large icon-home"></i><br> <div class="wrd">Dashboard</div></a></li>
<li><a href="#"><i class="icon-large icon-key"></i><br> <div class="wrd">Licenses</div></a></li>
<li><a href="#"><i class="icon-large icon-download-alt"></i><br> <div class="wrd">Downloads</div></a></li>
<li><a href="#"><i class="icon-large icon-question-sign"></i><br> <div class="wrd">Get help</div></a></li>
</ul>
</nav>
</section>
并排:
<section class="row-fluid">
<nav class="span2">
<ul class="nav nav-pills">
<li><a href="#"><i class="icon-large icon-home"></i><br> <div class="wrd">Dashboard</div></a></li>
<li><a href="#"><i class="icon-large icon-key"></i><br> <div class="wrd">Licenses</div></a></li>
<li><a href="#"><i class="icon-large icon-download-alt"></i><br> <div class="wrd">Downloads</div></a></li>
<li><a href="#"><i class="icon-large icon-question-sign"></i><br> <div class="wrd">Get help</div></a></li>
</ul>
</nav>
</section>
本质上,您只需覆盖一两个默认CSS 规则:
li {
text-align: center;
}
.icon-large {
font-size: 14pt;
}
.wrd {
padding-top: 5px !important;
}