function
rect() — CSS reference
Creates a rectangle with top, right, bottom and left coordinates from the reference-box top-left. Right and bottom are coordinates, not inward distances. Auto maps to the corresponding edge. Distinct from legacy comma-separated clip:rect().
Formal Syntax & Structure
css syntaxcss
rect([ <length-percentage> | auto ]{4} [ 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:rect(0 40px 60px 0)}</style><body><div id="a" aria-hidden="true"></div><p>Decorative shape example.</p></body></html>