overflow-x

Controls what happens to content that is wider than its container. It can be hidden, clipped, or made to scroll horizontally.

It is documented as part of the CSS Overflow specification.

/* Usage Example */
.image-gallery {
  /* Allows users to scroll horizontally through a row of images */
  overflow-x: scroll;
  white-space: nowrap;
}

/* Syntax */
overflow-x: visible;
overflow-x: hidden;
overflow-x: clip;
overflow-x: scroll;
overflow-x: auto;

/* Global values */
overflow-x: inherit;
overflow-x: initial;
overflow-x: revert;
overflow-x: revert-layer;
overflow-x: unset;
Widely available Since 2020 96% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2020.

1+
3.5+
3+
12+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC