Performance: Overflow property
MEDIUM IMPACT
Controls how content overflow is handled, affecting layout stability and paint performance.
div {
overflow: hidden;
width: 200px;
height: 100px;
}div {
overflow: visible;
width: 200px;
height: 100px;
}| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| overflow: visible | No extra nodes | Multiple reflows on content change | High paint cost due to overflow spill | [X] Bad |
| overflow: hidden | No extra nodes | Single reflow | Low paint cost due to clipping | [OK] Good |
| overflow: auto | No extra nodes | Reflows on scrollbar appearance | Medium paint cost | [!] OK |
| overflow-y: scroll | No extra nodes | Single reflow | Medium paint cost, stable layout | [OK] Good |