/
Border box sizing model
Border box sizing model
By default CSS height and width refers to the size of the content of an element.
This can make it very difficult to get the size of say input fields and divs to be the same if you fiddle with the padding. So changing the model to border-box is helpful since now the size refers to the content plus the size of the padding and border.
You can do tricks like box-sizing : inherit.
I would not recommend it though - it’s confusing when it comes to understanding the layout of a page - better to set the box-sizing explicitly.
See:
, multiple selections available,
Related content
CSS Borders - Useful for debugging
CSS Borders - Useful for debugging
More like this
CSS Font Families
CSS Font Families
More like this
Make a CSS sandbox!
Make a CSS sandbox!
More like this
Do no use CSS Anti-aliasing of fonts on the fly
Do no use CSS Anti-aliasing of fonts on the fly
Read with this
CSS Dimensions
CSS Dimensions
More like this
CSS Pseudo Class Selectors
CSS Pseudo Class Selectors
Read with this