I have the following Bootstrap version 4.1.1 page. I would like to change the background color of active toggle to white.
.nav-tabs {
margin-top: 3%;
border: none;
background: #0062cc;
border-radius: 1.5rem;
width: 28%;
float: right;
}
.nav-tabs .nav-link {
padding: 2%;
height: 34px;
font-weight: 600;
color: #fff;
border-top-right-radius: 1.5rem;
border-bottom-right-radius: 1.5rem;
}
.nav-tabs .nav-link:hover {
border: none;
}
.nav-tabs .nav-link.active {
width: 100px;
color: #d8dfe6;
border: 2px solid #0062cc;
border-top-left-radius: 1.5rem;
border-bottom-left-radius: 1.5rem;
}
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<div class="col-md-9 register-right">
<ul class="nav nav-pills nav-tabs nav-justified" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="home-tab" data-toggle="pill" href="#home" role="tab" aria-controls="home" aria-selected="true">Buyer</a>
</li>
<li class="nav-item">
<a class="nav-link " id="profile-tab" data-toggle="pill" href="#profile" role="tab" aria-controls="profile" aria-selected="false">Seller</a>
</li>
</ul>
</div>
2
Answers
Thank you all for your answers here what I found.
Here what i did.
create a class named tab in both list items and set one active.
use the following css to switch between
entire code
.
Does the following solve your problem?