Content-box sizing assigns the declared size to the content area. Padding and borders increase the final occupied space.
Worked example
<style>
.demo {
box-sizing: content-box;
width: 12rem;
padding: 1rem;
border: 4px solid teal;
}
</style>
<div class="demo">Content-box sizing</div>Implementation notes
Mixing sizing models within one component makes measurements hard to compare. Inspect the computed box model on both the parent and the measured child.
Try it yourself
Give two boxes the same width but different horizontal padding.
Open the CSS example →Editorial date October 13, 2025 · Published December 6, 2026