I have a basic navigation bar setup:
<nav>
<a href="#">Home</a>
<a href="#">About</a>
<a href="#">Register</a>
</nav>
Along with the CSS styling for the navigation and anchor tags:
nav
{
background-color:black;
color:white;
text-align:center;
font-size:150%;
padding:2%;
}
nav a
{
text-decoration:none;
color:white;
padding:2%;
}
nav a:hover
{
background-color:white;
color:black;
font-size:120%;
}
Everything looks good except that the nav container stretches when hovering over it due to the larger font size. How can I prevent this stretching effect on hover?