Performance: Line breaks and horizontal rules
LOW IMPACT
This concept affects page rendering speed and visual stability by how the browser processes line breaks and horizontal rules in the layout.
<p>Paragraph 1</p><p style="margin-top:2rem;">Paragraph 2</p><hr style="margin-top:2rem;">
<div>Paragraph 1</div><br><br><br><div>Paragraph 2</div><hr><hr><hr>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Multiple <br> and <hr> tags | Many extra nodes | Multiple reflows per tag | High paint cost due to layout thrashing | [X] Bad |
| Single <hr> with CSS spacing | Minimal nodes | Single reflow | Low paint cost | [OK] Good |