While developing bootstrap tabs for an Angular app, I decided to use the data-target
attribute instead of the href
attribute to avoid any interference with routes. Here's a snippet of how I structured the tabs:
<ul class="nav nav-tabs" id="myTab">
<li class="active"><a data-target="home">Home</a></li>
<li><a data-target="profile">Profile</a></li>
<li><a data-target="messages">Messages</a></li>
<li><a data-target="settings">Settings</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="home">...</div>
<div class="tab-pane" id="profile">...</div>
<div class="tab-pane" id="messages">...</div>
<div class="tab-pane" id="settings">...</div>
</div>
<script>
jQuery(function () {
jQuery('#myTab a:last').tab('show')
})
</script>
You can view a demo of this setup in action on this fiddle: http://jsfiddle.net/xFW8t/4/.
However, I faced an issue where the default Bootstrap styles were being applied to my tabs. I only want the functionality without the styling. Is there a way to prevent Bootstrap styles from being applied? Any assistance would be greatly appreciated. Thank you.