
Image by Erda Estremera from Unsplash
DESCRIPTION
Adjust box-sizing property to include padding and border to actual width or height. Simplifies overhead of the box model.
Preview
Border-box property
x
*, *:before, *:after {
box-sizing: border-box;
}
Summary
- Add the above code to your main CSS file to take effect.
- Select all selector targets all HTML elements, including all pseudo-elements.
- Then, the box-sizing property is overridden to
border-box
instead of defaultcontent-box
.