#nav_link {
background: orange;
display: flex;
justify-content: center;
outline: 2px solid white;
margin-top: 30px;
width: 12%;
height: 15rem;
}
#nav_link li {
display: table;
text-align: center;
font-size: 20px;
}
<nav>
<div id="nav_link">
<ul>
<li><a href="home.html">Home</a></li>
<li><a href="">About</a></li>
<li><a href="">Contact Us</a></li>
<li><a href="">Services</a></li>
<li><a href="">Pricing</a></li>
</ul>
</div>
</nav>
How to anchor tag inside a li in ul tag in CSS
i centered ul in div tag but how to vertically center li in ul tag.
3
Answers
The padding of ul is messing with the design
Include the nav_link ul
To vertically center the navbar links within the tag, you can use CSS flexbox along with the align-items: center property. Here’s an updated version of your CSS code: