Width
Utilities for setting the width of an element
Class reference
Auto
Use .w-auto
to let the browser calculate and select the width for the element.
<div class="w-24 md:w-auto ..."></div>
Screen Width
Use .w-screen
to make an element span the entire width of the viewport.
<div class=" h-12 w-screen"></div>
Fixed Width
Use .w-{number}
or .w-px
to set an element to a fixed width.
Fluid Width
Use .w-{fraction}
or .w-full
to set an element to a percentage based width.
Responsive
To control the width of an element at a specific breakpoint, add a {screen}:
prefix to any existing width utility. For example, adding the class md:w-full
to an element would apply the w-full
utility at medium screen sizes and above.
<div class="w-1/2 **md:w-full** ...">
<!-- ... -->
</div>
For more information about Elements’ responsive design features, check out the Responsive Design documentation.
On this Page
v1.13.5