Performance: Nesting rows and columns
MEDIUM IMPACT
Nesting rows and columns affects the DOM size and layout calculation time, impacting page rendering speed and visual stability.
<div class="row"> <div class="col"> Content </div> <div class="col"> Additional Content </div> </div>
<div class="row"> <div class="col"> <div class="row"> <div class="col"> Content </div> </div> </div> </div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Deeply nested rows and columns | High (many nested divs) | Multiple reflows per nested level | High paint cost due to layout thrashing | [X] Bad |
| Flat row with multiple columns | Low (few divs) | Single reflow | Low paint cost | [OK] Good |