Skip to Content
CSS in Depth
book

CSS in Depth

by Keith Grant
March 2018
Intermediate to advanced content levelIntermediate to advanced
472 pages
13h 5m
English
Manning Publications
Content preview from CSS in Depth

Box model and border-box sizing

The box model refers to the composition of elements on a page. When you specify the height or width of an element, you’re setting the content size—any padding, border, and margin will be added to that.

Applying box-sizing: border-box to an element changes the box model to a more predictable behavior. Setting height or width will control the size of the entire element, including its padding and border.

See chapter 3 for information on applying border-box sizing to the entire page, as well as other important concepts ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

CSS: The Definitive Guide, 4th Edition

CSS: The Definitive Guide, 4th Edition

Eric Meyer, Estelle Weyl
Tailwind CSS

Tailwind CSS

Ivaylo Gerchev

Publisher Resources

ISBN: 9781617293450Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link