← TechnologyThe essentials of

Width: sizing also depends on the box model

Publisher: ResumeMaker • 1 source

Published: 23 Oct 2026 08:23 · Updated: 23 Oct 2026 08:23

AI source check: 22 Oct 2026 16:54. This is not editorial approval.

In a few sentences

In brief

width sets a width, but the measured area depends on box-sizing. With content-box, the value describes content; padding and borders add to the outer size.

Useful to know

width sets a width, but the measured area depends on box-sizing. With content-box, the value describes content; padding and borders add to the outer size. [1]

If width: 100% causes horizontal overflow, check those additions. Rather than compensating with an arbitrary smaller percentage, first establish which box is being measured.

Sources

For further detail and to check the information:

  1. [1] MDN — CSS width ↗