I am working on a basic navigation bar that includes a hover effect.
.navip {
float: left;
text-decoration: none;
font-weight: lighter;
}
.navip > a {
display: block;
color: black;
text-decoration: none;
font-size: 20px;
font-weight: lighter;
line-height: 40px;
}
.navip > a:hover {
border-top: 3px solid blue;
}
When I hover over the link, the border appears but shifts the text slightly. How can I resolve this issue?
For more details and to see the code in action, visit JsFiddle: http://jsfiddle.net/w0btkceg/
Update: Issue resolved! I adjusted the height to 45 and added "border-top: 3px solid transparent" to the "navip a" class.