When I hover over an li-element, I want to apply borders at the top and bottom. Here's the code snippet:
#overview li:hover {
background: rgb(31, 31, 31);
border-top: 1px solid white;
border-bottom: 1px solid white;
}
Check out this JSFiddle example, where you can hover over the navigation on the left.
The issue is that it causes the li element to shift by 1 or 2 pixels when hovered. I attempted to add a margin-top: -1px
for the hover state, but it didn't fix the problem.
Do you have any suggestions?