property
mask-composite — CSS reference
Combines a mask layer with accumulated layers below it. Initial add; not inherited. Add is source-over, subtract source-out, intersect source-in, exclude xor. Order matters for subtract. The operators combine coverage rather than element colors.
Formal Syntax & Structure
css syntaxcss
[ add | subtract | intersect | exclude ]#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{mask-image:linear-gradient(to right,black 50%,transparent 50%),linear-gradient(to bottom,black 50%,transparent 50%);mask-composite:intersect}</style><body><div id="a" aria-hidden="true"></div><p>Decorative shape example.</p></body></html>