"Bootstrap 4 Right align Navbar"
Bootstrap 4.1.1 Snippet by testing223

<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="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <h2>Bootstrap 4 Right align Navbar</h2> </div> <nav class="navbar navbar-expand-lg navbar-light bg-warning"> <a class="navbar-brand" href="#">CAR DEALER</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarSupportedContent"> <ul class="navbar-nav ml-auto topnav"> <li class="nav-item active"> <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a> </li> <li class="nav-item"> <a class="nav-link" href="#">Shop Pre-Owned</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Shop New Cars</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Clearence Event</a> </li> <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> Resources </a> <div class="dropdown-menu" aria-labelledby="navbarDropdown"> <a class="dropdown-item" href="#">Carfax</a> <a class="dropdown-item" href="#">Carproof</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="#">Omnivic</a> </div> </li> <li class="nav-item"> <a class="nav-link" href="#">About</a> </li> <li class="nav-item"> <a class="nav-link" href="#">Contact</a> </li> <li class="nav-item"> <a class="nav-link btn btn-primary text-white" type="button" href="#" data-toggle="modal" data-target="#myModal">Sign In</a> </li> <li class="nav-item"> <a class="nav-link btn btn-danger text-white" type="button" href="#" data-toggle="modal" data-target="#myModal">Register</a> </li> </ul> </div> <!-- The Modal --> <div class="modal" id="myModal"> <div class="modal-dialog"> <div class="modal-content"> <!-- Modal Header --> <div class="modal-header"> <h4 class="modal-title">Customer Sign In</h4> <button type="button" class="close" data-dismiss="modal">×</button> </div> <!-- Modal body --> <div class="modal-body"> <form> <label class="sr-only" for="usrname">Username</label> <div class="input-group mb-3"> <div class="input-group-prepend"> <span class="input-group-text" id="basic-addon1"><i class="fa fa-user"></i></span> </div> <input type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="basic-addon1"> </div> <label class="sr-only" for="Password">Name</label> <div class="input-group mb-2"> <div class="input-group-prepend"> <span class="input-group-text" id="basic-addon2"><i class="fa fa-key"></i></span> </div> <input id="Password" type="password" class="form-control" placeholder="Password" aria-label="Password" aria-describedby="basic-addon2"> </div> </form> </div> <!-- Modal footer --> <div class="modal-footer"> <button type="submit" class="btn btn-primary" >Sign In</button> <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button> </div> </div> </div> </div> </nav> </div>
.topnav a:hover { border-bottom: 3px solid red; }

Related: See More


Questions / Comments: