Performance: Sizing utilities (width, height)
Sizing utilities affect layout calculation and paint times by changing element dimensions, impacting page rendering speed and visual stability.
<div class="w-50 h-25"></div>
<div class="w-100 h-100" style="width: 500px; height: 300px;"></div>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Using inline styles with sizing utilities | Low | Multiple reflows due to style conflicts | High paint cost from layout thrashing | [X] Bad |
| Using only Bootstrap sizing utility classes | Low | Single reflow | Lower paint cost with stable layout | [OK] Good |
w- for width and h- for height classes.w-50 sets width to 50%, while h-50 sets height to 50%.h-100 to set height to 100% of the parent container.vh-100 to set height to 100vh. To set height to viewport height, custom CSS or utility classes are needed.<div class='w-75'></div> element relative to its parent container?w-75 sets the element's width to 75% of its parent container.<div class='w-25'></div> does not work as expected. What is the error?w-25 sets width to 25%, not height.h-25 instead of w-25.w-25 instead of height class h-25 -> Option Amd to apply styles at medium screen sizes and above.w-100 sets width 100% on all screens, but w-md-50 overrides width to 50% on medium and larger screens.Pass the test and this pattern moves unknown