Tabs

Note the .nav-tabs class requires the .nav base class. Tabs also uses HTML5 roles for accessibility. Add role="tablist" to the ul that contains the tab links, and add role="tab" to the anchor tag that is the tab link. The tab link also requires an HTML5 data-toggle="tab" attribute be applied to instantiate the javascript behavior.

The tab panel uses standadard deep linking markup to target the appropriate tab panel. As such the tabs href should match the ID of the tab panel it targets. For example href="#home" will show the id="home" tab panel

Any tab panel can be the first or default tab by applying .active to the tablist li element and to the corosponding tab panel.

Tabs on small mobile devices can be a really bad experience. By applying the .responsive class to the ul.nav-tabs element and to the div.tab-content element, the tab will transform from a tab list to an accordion list on small mobile devices.


Examples:



Sidebar tabs use nearly the exact same markup, however the .responsive class is not necessary as the tabs are limited to begin with.

Example: