CSS overflow-clip-margin Property
Description
The overflow-clip-margin property controls an offset applied to an element’s overflow clipping box — the rectangle used to decide which parts of the element and its descendants are painted when content is clipped. In practice this means you can expand or contract the visual clipping region without changing the element’s layout or the size of its box; decorative effects that would normally be cut off (like shadows or focus rings) can be kept visible by increasing the clip margin, while tightening the margin can purposely hide more of the painted content. This property therefore acts purely at the clipping/painting stage and does not alter intrinsic sizing, reflow, or how content is laid out.
Because it operates on the clipping region, overflow-clip-margin is closely related to how overflow is handled. Authors commonly use it together with overflow to prevent abrupt visual truncation when an element’s overflow creates a hard clip. It is conceptually distinct from shape-based clipping: a geometric clip created with clip-path defines a specific shape to cut content, whereas overflow-clip-margin merely nudges the rectangular overflow clipping box inward or outward. That distinction means you can use both: the rectangular overflow clip (adjusted by this property) can still be further restricted by a shape clip if one is applied.
Common practical uses include avoiding clipped box shadows and ensuring focus outlines remain visible. For example you might expand the clip margin when an element has a strong box-shadow or a visible focus ring to prevent those visuals from being abruptly cut off at the element boundary. Conversely, shrinking the clip margin can be used as a subtle visual mask when you want content to be tightly cropped without affecting spacing. Because the change only affects painting, it’s a lightweight tool for fine-tuning visuals compared with altering layout or adding extra wrapper elements.
Finally, keep in mind that the adjusted clipping region affects painting for the element and its descendants — what gets composited and potentially hit-tested — but it does not change the element’s layout metrics. That means things like scrollable extents and intrinsic size calculations remain based on the original box; the property’s purpose is to give designers control over the visual cut-off without the side effects of changing box geometry. If you rely on precise hit-testing or scroll behavior, test how the adjusted clip interacts with your particular layout and interaction patterns.
Definition
- Initial value
- 0px
- Applies to
- all elements
- Inherited
- no
- Computed value
- the computed <length> and a <visual-box> keyword
- Animatable
- yes
- JavaScript syntax
- object.style.overflowClipMargin
Syntax
overflow-clip-margin: <visual-box> | <length>
Values
- <visual-box>Specifies the box edge to use as the overflow clip edge origin.
- <length>Specifies the length, must be nonnegative.
Example
Browser Support
The following information will show you the current browser support for the CSS overflow-clip-margin property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported in some modern browsers, but not all.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
