Our bootstrap nav-tabs have a unique default look with an 'indicator' icon below the selected tab. This is achieved by styling the active anchor element as follows:
https://i.sstatic.net/UQos5.png
However, when migrating to bootstrap 4, we noticed that the indicator no longer aligns properly with the tab.
HTML
<div class="container">
<div class="row">
<div class="col-12">
<ul class="pt-3 nav nav-tabs" id="nav-tab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="nav-home-tab" data-toggle="tab" href="#nav-home" role="tab" aria-controls="nav-home" aria-selected="true">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" id="nav-profile-tab" data-toggle="tab" href="#nav-profile" role="tab" aria-controls="nav-profile" aria-selected="false">Profile</a>
</li>
</ul>
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade active show" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab">
<p>Home Content</p>
</div>
<div class="tab-pane fade" id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab">
<p>Profile Content</p>
</div>
</div>
</div>
</div>
</div>
CSS
Javascript (inside document load or ready)
After applying our legacy CSS for the tabs in bootstrap 4, we encountered alignment issues with the indicator. See the updated look below:
https://i.sstatic.net/V3OzE.png
For more details and to see the output, visit our JS Fiddle link: http://jsfiddle.net/nLe1b30u/