How can I adjust the vertical position of li elements without impacting the height of the navigation bar?
Below is the code snippet in question:
body {
margin: 0px;
}
ul {
margin: 0px;
padding: 0px;
list-style: none;
padding-left: 5px;
padding-top: 10px;
background-color: #333;
overflow: hidden;
}
li {
float: left;
height: 30px;
width: 100px;
background-color: grey;
color: white;
margin-right: 4px;
text-align: center;
line-height: 30px;
font-weight: bold;
font-size: 15px;
}
li a {
text-decoration: none;
color: white;
display: block;
}
ul li:hover {
opacity: 0.8;
}
<ul>
<li><a href="kalli.html">Home</a></li>
<li><a href="mp.html">My Profile</a></li>
<li><a href="set.html">Settings</a></li>
</ul>