我正在尝试使用bootstrap 2.3.2中提供的bootstrap.js v3.0.0在左侧创建选项卡。
但它没有在左边显示标签。
请参阅this fiddle了解详情。
<div class="container">
<div class="tabbable tabs-left">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab1" data-toggle="tab">Tab 1</a>
</li>
<li><a href="#tab2" data-toggle="tab">Tab 2</a>
</li>
<li><a href="#tab3" data-toggle="tab">Tab 3</a>
</li>
<li><a href="#tab4" data-toggle="tab">Tab 4</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab1">
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium
doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore
veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim
ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia
cor magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro
quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci
velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore
magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum
exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea
commodi consequatur?</p>
</div>
<div class="tab-pane" id="tab2">
<p>Section 2...</p>
</div>
<div class="tab-pane" id="tab3">
<p>Section ...</p>
</div>
<div class="tab-pane" id="tab4">
<p>Section ...</p>
</div>
</div>
</div>
答案 0 :(得分:1)
你的标记很好,你只需要一些CSS(http://jsfiddle.net/5QRky/2/)
.tabs-left > .nav-tabs > li, .tabs-right > .nav-tabs > li {
float: none;
}
.tabs-left > .nav-tabs > li > a, .tabs-right > .nav-tabs > li > a {
min-width: 74px;
margin-right: 0;
margin-bottom: 3px;
}
.tabs-left > .nav-tabs {
float: left;
margin-right: 19px;
border-right: 1px solid #ddd;
}
.tabs-left > .nav-tabs > li > a {
margin-right: -1px;
-webkit-border-radius: 4px 0 0 4px;
-moz-border-radius: 4px 0 0 4px;
border-radius: 4px 0 0 4px;
}
.tabs-left > .nav-tabs > li > a:hover, .tabs-left > .nav-tabs > li > a:focus {
border-color: #eeeeee #dddddd #eeeeee #eeeeee;
}
.tabs-left > .nav-tabs .active > a, .tabs-left > .nav-tabs .active > a:hover, .tabs-left > .nav-tabs .active > a:focus {
border-color: #ddd transparent #ddd #ddd;
*border-right-color: #ffffff;
}