Is there a better way to do this? It seems there should be a more automatic way of doing it, without adjusting it pixel by pixel. I’m using Flexbox, so maybe there is a feature I could use?
I tried adding that, but the background on hover still doesn’t fit the maximum height. I tried getting rid of the padding and margins in li:hover as well.
How did that fix the padding difference of the navigation container (25px) and the hover padding/margin (30px) for the list-items?
N.B. The common general reset should only be used for testing! It is not recommended in any other case because that messes with all element. Instead reset the elements that needs it in current code.
Next time I’ll put my whole project on Codepen, because this is where the confusion came from. I tried giving a sample in the link above that highlighted the problem. The reason I got mixed up is because I tested it on my project thinking it would be the same as the Codepen link.
I did the general reset for other parts of the site. That is a good point that it’s only for testing. I didn’t know that and I won’t do it that way anymore.