function

path() — CSS reference

Uses a quoted SVG path-data string. In clip-path, coordinates are CSS-pixel distances from the reference-box origin. Unlike shape(), the string cannot contain responsive CSS percentage coordinates.

Formal Syntax & Structure

css syntaxcss
path([ <fill-rule> , ]? <string>)

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:path("M 0 0 L 80 0 L 0 60 Z")}</style><body><div id="a" aria-hidden="true"></div><p>Decorative shape example.</p></body></html>
CSS Reference