2016-06-07 60 views
0

在引導程序版本3的Toggable Tabs的文檔中,導航選項卡和選項卡窗格在同一個div內。這有什麼好處嗎?在導航選項卡和選項卡窗格在同一個div有沒有什麼好處?

<div> 

    <!-- Nav tabs --> 
    <ul class="nav nav-tabs" role="tablist"> 
    <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">Home</a></li> 
    <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">Profile</a></li> 
    <li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">Messages</a></li> 
    <li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">Settings</a></li> 
    </ul> 

    <!-- Tab panes --> 
    <div class="tab-content"> 
    <div role="tabpanel" class="tab-pane active" id="home">...</div> 
    <div role="tabpanel" class="tab-pane" id="profile">...</div> 
    <div role="tabpanel" class="tab-pane" id="messages">...</div> 
    <div role="tabpanel" class="tab-pane" id="settings">...</div> 
    </div> 

</div> 

相比,只是有

<!-- Nav tabs --> 
<ul class="nav nav-tabs" role="tablist"> 
    <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">Home</a></li> 
    <li role="presentation"><a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">Profile</a></li> 
    <li role="presentation"><a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">Messages</a></li> 
    <li role="presentation"><a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">Settings</a></li> 
</ul> 

<!-- Tab panes --> 
<div class="tab-content"> 
    <div role="tabpanel" class="tab-pane active" id="home">...</div> 
    <div role="tabpanel" class="tab-pane" id="profile">...</div> 
    <div role="tabpanel" class="tab-pane" id="messages">...</div> 
    <div role="tabpanel" class="tab-pane" id="settings">...</div> 
</div> 

回答

1

它一般情況下最好將多達內容,但似乎作爲DIV沒有添加一個類到它,它其實並不重要。

相關問題