On my nav bar there are two nav links with rounded borders, which when they are hovered, the border size doubles. I can’t get it to work without the nav link moving on hover and the hover border doesn’t match the area of the original border. I’m sure it has to do with padding but I’ve tried everything I can think of. See example code – http://jsfiddle.net/mGjs6/3/
Share
You need to change
#signup a:hoverto
#signup:hoverand remove the
widthExample: http://jsfiddle.net/jasongennaro/mGjs6/6/
Same with
#clientareaThe issue with the not matching up was the one element
#signuphad the border but then you were changing the border of a child element (a) on hover.EDIT
As per the comment
That happens because the border size is increasing. That is what is pushing the text down a pixel (that’s the increase in border size)
You can’t fix that perfectly. Better to change the color of the border or the background.
Example 2: http://jsfiddle.net/jasongennaro/mGjs6/9/
(Hover over both to see the suggestions)
EDIT 3
I figured it out: decrease the
paddingby a pixel on the hover and it all worksExample 3: http://jsfiddle.net/jasongennaro/mGjs6/10/