The second method uses the inner shadow of the box-shadow box shadow. I won’t post the specific code. If you don’t understand, just learn it yourself. If the subject of the question caused the layout to be damaged because of the border, you need to understand how the box model of the element is calculated.
box-sizing:border-box; not supported under IE8
box-sizing:border-box;
There is no css attribute that can directly create the effect you want, you can only simulate it
style="
"
The height and width remain unchanged and the padding is set to the border
There are two implementation options,
The first one uses css pseudo-classes
The second method uses the inner shadow of the box-shadow box shadow. I won’t post the specific code. If you don’t understand, just learn it yourself.
If the subject of the question caused the layout to be damaged because of the border, you need to understand how the box model of the element is calculated.