function

xywh() — CSS reference

Defines a rectangle by x and y offsets then width and height, optionally rounded. Offsets can be negative; width and height are nonnegative. Percentages follow the corresponding axis.

Formal Syntax & Structure

css syntaxcss
xywh(<length-percentage>{2} <length-percentage [0,∞]>{2} [ round <border-radius> ]?)

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:xywh(0 0 50% 100%)}</style><body><div id="a" aria-hidden="true"></div><p>Decorative shape example.</p></body></html>
CSS Reference