I have to implement Tab control in the ASP.NET MVC 3.1 which contains bootstrap 4.3.1. Could you please help me? I have just put the HTML markup as below:
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#home">Home</a></li>
<li><a data-toggle="tab" href="#menu1">Menu 1</a></li>
</ul>
<div class="tab-content">
<div id="home" class="tab-pane fade in active">
<h3>HOME</h3>
<p>Some content.</p>
</div>
<div id="menu1" class="tab-pane fade">
<h3>Menu 1</h3>
<p>Some content in menu 1.</p>
</div>
</div>
This is not rendering the tab properly which is something like the screenshot below:
Why don't people reference back to the Bootstrap documentation first to check if they have a valid structure or not?
.nav-item
after .nav
, so in your case, <li />
needs the class .nav-item
..nav-link
, which brings in some paddings..in
is changed to .show
.demo: https://jsfiddle.net/davidliang2008/sarmvoct/16/
You can style .tab-content
with paddings to create something that matches up your screenshot:
.tab-content {
padding: 1rem .25rem;
}