Box-sizing inherited from the html element

In most cases we set the elements borderand paddingdo not want to change the elements of width,heightvalue, 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-sizingvalue, and need not be repeated for each elementbox-sizing:border-box;

Guess you like

Origin www.cnblogs.com/web-record/p/10942715.html