Performance: What is an HTML element
MEDIUM IMPACT
HTML elements form the structure of a webpage and affect how quickly the browser can build and display content.
<main><p>Text</p></main>
<div><div><div><p>Text</p></div></div></div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Deeply nested <div>s | Many nodes, deep tree | Multiple reflows | High paint cost | [X] Bad |
| Semantic elements with minimal nesting | Fewer nodes, shallow tree | Single reflow | Low paint cost | [OK] Good |