How CSS's box-sizing property works

Posted on: Monday, Dec 31, 2018

This CodePen explains how CSS's box-sizing property works. The short story is that

* {
    box-sizing: border-box;
}

is the setting you'll almost always want to use. It ensures that padding and border widths don't affect the assigned width and/or height of an element.

See the Pen box-sizing options by roger pence (@rogerpence) on CodePen.




Add your comment
You email is never shared with anyone else.

© Copyright 2017 by Roger Pence. All rights reserved.