Appreciate everyone for sharing your insights, here's what I discovered.
Here's what I implemented:
I created a class named "tab" in both list items and set one as active.
<ul class="nav nav-pills nav-tabs nav-justified" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link " class="tab active" data-toggle="pill" href="#home" role="tab" aria-controls="home" aria-selected="true">Buyer</a>
</li>
<li class="nav-item">
<a class="nav-link " class="tab" data-toggle="pill" href="#profile" role="tab" aria-controls="profile" aria-selected="false">Seller</a>
</li>
</ul>
I used the following CSS to toggle:
.active, .tab:hover
{
background-color: white;
color: black;
border-top-left-radius: 1.5rem;
border-top-right-radius: 1rem;
border-bottom-left-radius: 1.5rem;
}
Here's the complete code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Register</title>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<style>
.nav-tabs{
margin-top: 3%;
border: none;
background: #0062cc;
border-radius: 1.5rem;
width: auto;
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{
width: 100px;
color: rgb(240, 237, 237);
border: 2px solid #0062cc;
border-top-left-radius: 1.5rem;
border-bottom-left-radius: 1.5rem;
}
.active, .tab:hover
{
background-color: white;
color: black;
border-top-left-radius: 1.5rem;
border-top-right-radius: 1rem;
border-bottom-left-radius: 1.5rem;
}
</style>
<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 " class="tab active" data-toggle="pill" href="#home" role="tab" aria-controls="home" aria-selected="true">Buyer</a>
</li>
<li class="nav-item">
<a class="nav-link " class="tab" data-toggle="pill" href="#profile" role="tab" aria-controls="profile" aria-selected="false">Seller</a>
</li>
</ul>
</div>
</body>
</html>
.