When you start setting the border width of the div to 1px, the page that appears is like this
Then the mouse slides over the border and the width becomes 2px
But if you start If the border width is set to 2px, the above situation will not occur. May I ask why the above situation occurs?
Height, etc., all have an impact
The height occupied by an element is equal to the sum of the set height attribute, padding, and border width (lower versions of IE calculate it differently).
If the width of the border changes, the height of the element will change.
So it will affect the layout of the entire page.
Who is this sister? Let me introduce you
Usually I will put a div outside and set the border width, but the color is transparent
Just give me a color when you mouse over it
The advantage is that the entire width is fixed