In most cases we set the elements border
and padding
do not want to change the elements of width,height
value, this time we can set that element box-sizing:border-box;
.
I do not want to rewrite it every time, but I hope he is inherited, then we can use the following code:
html { box-sizing: border-box; } *, *:before, *:after { box-sizing: inherit; }
The advantage is that he does not override the other components of box-sizing
value, and need not be repeated for each elementbox-sizing:border-box;