Performance: Common box model issues
MEDIUM IMPACT
This affects page layout stability and rendering speed by causing unexpected size calculations and layout shifts.
div {
width: 300px;
padding: 20px;
border: 5px solid black;
box-sizing: border-box;
}div {
width: 300px;
padding: 20px;
border: 5px solid black;
box-sizing: content-box;
}| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| content-box with padding and border | Minimal | Multiple reflows if size changes | Higher due to layout shifts | [X] Bad |
| border-box with padding and border | Minimal | Single reflow | Lower paint cost, stable layout | [OK] Good |