BS5 Sizing
On this page
Width utilities
w-25 w-50 w-75 w-100 w-auto
Height utilities
h-25 h-50 h-75 h-100 h-auto
Max width and max height
mw-100 mh-100
Common examples
<div class="w-50 bg-light p-3">50% width</div> <div class="w-100 bg-light p-3">Full width</div> <img src="photo.jpg" class="mw-100" alt="...">
Viewport helpers
Bootstrap focuses on common sizing utilities. For full viewport layouts, use custom CSS when needed:
min-height: 100vh; min-width: 100vw;
Best practices
- Use sizing utilities for quick layout adjustments
- Avoid fixed pixel heights for content blocks
- Combine sizing with flex or grid for stronger layouts