Performance: Clean HTML structure
MEDIUM IMPACT
Clean HTML structure improves browser parsing speed and reduces layout shifts, enhancing page load and visual stability.
<header><h1>Title</h1></header>
<div><div><div><span>Title</span></div></div></div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Deeply nested generic <div>s | High (many nodes, deep nesting) | Multiple reflows during layout | Higher paint cost due to complex layout | [X] Bad |
| Semantic, shallow structure | Low (fewer nodes, shallow nesting) | Single reflow | Lower paint cost with stable layout | [OK] Good |