Performance: Why a grid system matters
A grid system affects page layout speed and visual stability by controlling how content is arranged and resized.
<div class="container"><div class="row"><div class="col-6">Content A</div><div class="col-6">Content B</div></div></div>
<div style="width: 50%; float: left;">Content A</div><div style="width: 50%; float: left;">Content B</div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Float-based layout | Moderate | Multiple on resize | High due to layout shifts | [X] Bad |
| Bootstrap grid system | Moderate | Single on resize | Low due to stable layout | [OK] Good |
.row to group columns horizontally..row, not any other variant..row -> Option A.row [OK].row always [OK].container-row instead of .row<div class="row"> <div class="col-6">Left</div> <div class="col-6">Right</div> </div>
col-6 means the column takes 6 out of 12 parts, or half the row width.col-6 columns inside a row will sit side by side, each occupying half the horizontal space.<div class="row"> <div class="col-4">One</div> <div class="col-5">Two</div> <div class="col-5">Three</div> </div>
col-12 means full width on extra small screens; col-md-4 means one-third width on medium and larger screens.col-12 col-md-4 for each column stacks them vertically on small screens and places them side by side on medium+ screens.col-12 col-md-4 for each column -> Option APass the test and this pattern moves unknown