Performance: Float and clear utilities
MEDIUM IMPACT
Float and clear utilities affect layout calculation and visual stability during page rendering.
<div class="float-start">Left</div> <div class="float-start">Right</div> <div class="clearfix"></div> <div>Content below floats</div>
<div class="float-start">Left</div> <div class="float-start">Right</div> <div>Content below floats</div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Floats without clear | Normal DOM nodes | Multiple reflows due to layout shifts | Higher paint cost from unstable layout | [X] Bad |
| Floats with .clearfix | Normal DOM nodes plus clear element | Single reflow with stable layout | Lower paint cost due to visual stability | [OK] Good |