overflow: clip
The overflow: clip CSS declaration clips an element's overflowing content to the box that's defined by the overflow-clip-margin property. Unlike overflow: hidden, it allows you to hide overflow on one axis while keeping overflow on the other axis visible.
Overview
The overflow: clip CSS declaration clips an element's overflowing content to the box that's defined by the overflow-clip-margin property. Unlike overflow: hidden, it allows you to hide overflow on one axis while keeping overflow on the other axis visible.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
css.properties.overflow-x.clip | 90 | 90 | 81 | 16 | 90 | 16 |
| CSS property | ||||||
clip | 90 | 90 | 81 | 16 | 90 | 16 |
clip | 90 | 90 | 81 | 16 | 90 | 16 |
| CSS type | ||||||
clip | 90 | 90 | 81 | 16 | 90 | 16 |
- This feature was removed in a later browser version (81)
- Previously available under a different name: -moz-hidden-unscrollable (3.5)
- This feature was removed in a later browser version (81)
- Previously available under a different name: -moz-hidden-unscrollable (3.5)
- This feature was removed in a later browser version (81)
- Previously available under a different name: -moz-hidden-unscrollable (1.5)
- This feature was removed in a later browser version (81)
- Previously available under a different name: -moz-hidden-unscrollable (1.5)
Syntax
/* Pure clipping */
.clipped {
overflow: clip;
}
/* Clipping in one direction only */
.horizontal-clip {
overflow-x: clip;
overflow-y: visible;
} Live demo
Use cases
Using overflow: clip
The overflow: clip CSS declaration clips an element's overflowing content to the box that's defined by the overflow-clip-margin property. Unlike overflow: hidden, it allows you to hide overflow on one axis while keeping overflow on the other axis visible.
Cautions
- May not be supported in older browsers.
Accessibility
- Make sure visual changes are conveyed appropriately to assistive technology.
Related links
Powered by web-features