property

clip-path — CSS reference

Limits where an element and its descendants paint. Initial none; not inherited. A non-none value creates a stacking context. Clipped-out regions are not hit-testable; layout remains unchanged. Clipping is not a substitute for hiding content from assistive technology.

Formal Syntax & Structure

css syntaxcss
none | <url> | [ <basic-shape> || <geometry-box> ]

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS masking and shapes lab</title><style>body {margin:0} .sample {background:#dcebe9;color:#182e32}body{background:white} #a{position:relative;margin:20px;width:80px;height:60px;background:red;box-sizing:content-box}#a{clip-path:inset(0 50% 0 0)}</style><body><div id="a" aria-hidden="true"></div><p>Decorative shape example.</p></body></html>
CSS Reference