![]() |
VOOZH | about |
Bootstrap 5 Sizing utility classes adjust element dimensions relative to the viewport or parent container. Options include percentage-based widths, and viewport-relative dimensions, facilitating responsive design for flexible layouts across various screen sizes.
Bootstrap 5 Sizing Classes
| Class Name | Description |
|---|---|
| Relative to the Parent | Sets the height and width of the element relative to its parent. |
| Relative to the Viewport | Sets the height and width of the element relative to the viewport. |
| Sass | Sass sizing utilities declared in the Utility API. |
Syntax:
<div class="w-25">
...
</div> Example 1: In this example, we used the sizing classes relative to the parent to set the height and width of the element.
Output:
Example 2: In this example, we used the sizing classes relative to the viewport to set the height and width of an element.
Output: