Box-Sizing

Thomas Mak wrote at 2017-04-19.

#css

This set all elements to use the whole box for the width and height setting.

*{
  box-sizing: border-box;
}

Video Demo

http://codepen.io/makzan/pen/qmbLVz

Further Readings

The MDN doc:

https://developer.mozilla.org/en/docs/Web/CSS/box-sizing

The best practice from CSS-Tricks:

html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}

Source: https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/

Comments

no comments yet.