Contents
Quick reference
Class | Properties |
---|---|
.w-25 | width: 25%; |
.w-50 | width: 50%; |
.w-75 | width: 75%; |
.w-100 | width: 100%; |
.w-auto | width: auto; |
.vw-100 | width: 100vw; |
.mw-100 | max-width: 100%; |
.min-vw-100 | min-width: 100vw; |
Basic usage
Fixed width
Use w-{number}
to set an element to a fixed width.
w-100
w-75
w-50
w-25
<div class="w-100">w-100</div>
<div class="w-75">w-75</div>
<div class="w-50">w-50</div>
<div class="w-25">w-25</div>
Auto width
Use w-auto
to set width of an element to an auto.
w-auto
w-auto
<span class="w-auto ...">w-auto</span>
<div class="w-auto ...">w-auto</div>
Full viewport width
Use vw-100
to make an element span the entire width of the viewport.
<div class="vw-100 ..."></div>
Set mx width
Use mh-100
to set the maximum height of an element that is full, depending on the parent element.
<div class="mh-100 ..."></div>
Edit this page on Github
Last edited by zhengchun on November 30, 2023