The same width under content-box and border-box
box-sizing: content-box;
box-sizing: border-box;
width: 200px;
padding: 20px;
border: 5px solid;content-box grows outside the declared width. border-box keeps the border box at the declared width.
- Arithmetic: content-box border box is 200 + 40 + 10 = 250px. border-box content is 200 − 40 − 10 = 150px. Margin is omitted from both.
<div class="row">
<div class="box content">content-box</div>
<div class="box border">border-box</div>
</div>
<style>
.row { display: flex; gap: 16px; align-items: flex-start; }
.box { width: 200px; padding: 20px; border: 5px solid #0B5853; }
.content { box-sizing: content-box; }
.border { box-sizing: border-box; }
</style>What this markup means
Both boxes declare width: 200px, padding: 20px, and a 5px border. The content-box border box is 250px wide. The border-box border box stays 200px, with 150px of content. This is the same rule as the tutorial’s 280px card, not a different model.
Related: CSS tutorial: box model, Display