Overflow
Controls how an element behaves when content overflows.
Widely available
This feature is well established and works across many devices and browser versions.
| Class | Style |
|---|---|
o-auto | overflow: auto; |
o-c | overflow: clip; |
o-h | overflow: hidden; |
o-s | overflow: scroll; |
o-v | overflow: visible; |
Visible
Initial value
The content will overflow the container and be visible outside of it.
<div class="b-1 bc-slate b-d h-32 o-v p-2 w-64"> <div class="h-64 tc-slate w-full">Michaelmas term lately over, and the Lord Chancellor sitting in Lincoln's Inn Hall. Implacable November weather. As much mud in the streets as if the waters had but newly retired from the face of the earth.</div></div>Auto
The element will add scrollbars if the content overflows the container.
<div class="b-1 bc-slate b-d h-32 o-auto p-2 w-64"> <div class="h-64 tc-slate w-full">Michaelmas term lately over, and the Lord Chancellor sitting in Lincoln's Inn Hall. Implacable November weather. As much mud in the streets as if the waters had but newly retired from the face of the earth.</div></div>Clip
The content that overflows the container will be clipped and not visible.
<div class="b-1 bc-slate b-d h-32 o-c p-2 w-64"> <div class="h-64 tc-slate w-full">Michaelmas term lately over, and the Lord Chancellor sitting in Lincoln's Inn Hall. Implacable November weather. As much mud in the streets as if the waters had but newly retired from the face of the earth.</div></div>Hidden
The content that overflows the container will be hidden and not visible, without scrollbars.
<div class="b-1 bc-slate b-d h-32 o-h p-2 w-64"> <div class="h-64 tc-slate w-full">Michaelmas term lately over, and the Lord Chancellor sitting in Lincoln's Inn Hall. Implacable November weather. As much mud in the streets as if the waters had but newly retired from the face of the earth.</div></div>Scroll
The element will always show scrollbars, regardless of whether the content overflows.
<div class="b-1 bc-slate b-d h-32 o-s p-2 w-64"> <div class="h-64 tc-slate w-full">Michaelmas term lately over, and the Lord Chancellor sitting in Lincoln's Inn Hall. Implacable November weather. As much mud in the streets as if the waters had but newly retired from the face of the earth.</div></div>Using utility variants
Learn how to override existing utilities based on the user's screen size or other factors, such as hover states.
Targeting different viewports
You can combine responsive breakpoints like sm:o-*, md:o-*, lg:o-*, and xxl:o-* to allow targeting specific utilities in different viewports.
Targeting hover states
Alternatively, you can apply :hover by using h:o-* utility to override elements and change their values when hovering over them.