liveBook · Manning

Box-sizing

The CSS box-sizing property determines whether an element’s specified width and height include its padding and border areas.

How 2 Manning books explain it

Acing the Frontend Interview

The CSS box-sizing property determines whether an element's declared width and height include padding and borders.

How it is used
Supports predictable, maintainable CSS layouts by controlling whether declared element dimensions include padding and borders.
How deep it goes
Defines both sizing modes and works through width and height calculations for one element.
Examples
Compares a 100px-by-50px element measuring 148px by 81px under `content-box` with its declared size under `border-box`.
What you can do after
Operate/configure it in CSS to include padding and borders within an element’s declared dimensions.

Read how Acing the Frontend Interview explains box-sizing →

CSS in Depth, Second Edition

The CSS box-sizing property determines how an element's declared width and height relate to its content, padding, and border boxes.

How it is used
Uses border-box sizing to make padded and bordered layouts align more predictably, including responsive page styling.
How deep it goes
Explains content-box versus border-box, demonstrates a heading fix, and recommends a universal rule while warning about legacy styles.
Examples
Uses a padded page heading, a 1080px content constraint, a universal selector fix, and a responsive coffee-roaster page.
What you can do after
Apply border-box sizing to individual elements or establish it globally in a new stylesheet.

Read how CSS in Depth, Second Edition explains box-sizing →

Also covered in

What to know first

Related concepts

Questions about box-sizing

What is box-sizing?

The CSS box-sizing property determines whether an element’s specified width and height include its padding and border areas.

Which Manning books explain box-sizing?

Acing the Frontend Interview and CSS in Depth, Second Edition.

What should I know before learning box-sizing?

Manning books that teach box-sizing usually introduce border, padding, block-level element and CSS first.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.