My bootstrap top navigation bar appears as shown below: https://i.sstatic.net/llqGh.png When I hover over each of the items labeled LOREM, it changes to this: https://i.sstatic.net/yGAd8.png How can I adjust my code so that the spacing above and below the LOREM items is equal in the navbar, like this:
https://i.sstatic.net/ioyW9.png
Please keep the underline intact. I just need the LOREM items to have consistent spacing when not hovered. Below you will find my HTML and CSS code for reference:
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Resize</title>
<meta charset="utf-8"></meta>
<meta name="viewport" content="width=device-width, initial-scale=1" ></meta>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</head>
<style type="text/css">
.navbar-custom {
background-color: #484848;
}
ul.ml-auto > li > a > span{
font: 15px Roboto,sans-serif;
font-weight: 500;
position: relative;
display: inline-block;
color: #FFFFFF80;
overflow: hidden;
padding-bottom: 5px;
}
ul.ml-auto > li > a > span::before {
position: absolute;
content: attr(data-content);
color: #00FFFF;
clip-path: polygon(0 0, 0 0, 0% 100%, 0 100%);
transition: clip-path 275ms ease;
display: block;
border-bottom: 2px solid #00FFFF;
padding-bottom: 4px;
}
ul.ml-auto > li > a > span:hover::before {
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
</style>
<body>
<nav class="navbar navbar-custom navbar-expand-lg navbar-dark fixed-top py-2" id="mainNav">
<div class="container">
<a style="font: 20px Arial,sans-serif" class="navbar-brand js-scroll-trigger" href="#">HOME</a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul style="font: 15px Roboto,sans-serif" class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#about"><span data-content="LOREM">LOREM</span></a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#expertise"><span data-content="LOREM">LOREM</span></a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#portfolio"><span data-content="LOREM">LOREM</span></a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#contact"><span data-content="LOREM">LOREM</span></a>
</li>
</ul>
</div>
</div>
</nav>
</body>
</html>