PositioningOverflow X

Overflow X

Controls how an element behaves when content overflows on the X-axis.

Widely available

This feature is well established and works across many devices and browser versions.

Chrome
Edge
Firefox
Safari
ClassStyle
o-x-autooverflow-x: auto;
o-x-coverflow-x: clip;
o-x-hoverflow-x: hidden;
o-x-soverflow-x: scroll;
o-x-voverflow-x: visible;

Visible

Initial value

Ensures that any content overflowing horizontally remains visible outside the container.

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 class="b-1 bc-slate b-d h-32 o-x-v p-2 w-64">
<div class="h-full tc-slate w-96">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

Allows the content to scroll horizontally if it overflows the container, while hiding the scrollbar when not needed.

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 class="b-1 bc-slate b-d h-32 o-x-auto p-2 w-64">
<div class="h-full tc-slate w-96">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

Clips the content that overflows horizontally, preventing it from being displayed or scrolled.

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 class="b-1 bc-slate b-d h-32 o-x-c p-2 w-64">
<div class="h-full tc-slate w-96">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

Hides any content that overflows horizontally, ensuring it is not visible or scrollable.

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 class="b-1 bc-slate b-d h-32 o-x-h p-2 w-64">
<div class="h-full tc-slate w-96">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

Enables a horizontal scrollbar for the container, allowing users to scroll through the content even if it doesn’t overflow.

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 class="b-1 bc-slate b-d h-32 o-x-s p-2 w-64">
<div class="h-full tc-slate w-96">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-x-*, md:o-x-*, lg:o-x-*, and xxl:o-x-* to allow targeting specific utilities in different viewports.

Targeting hover states

Alternatively, you can apply :hover by using h:o-x-* utility to override elements and change their values when hovering over them.