CSS mask-composite property
Browser support · legacy reference
ChromePartial support
SafariPartial support
FirefoxPartial support
Internet ExplorerPartial support
EdgePartial support
OperaPartial support
Description
CSS mask-composite property defines multiple composite operations to combine multi mask layers.
The first url layer is at the top i.e. close to the user. The last url is at the bottom of all the layers i.e. far away from the user.
In the demo, the circle is closer to the user than the square shape. Then the source layer is the circle while the square is the destination layer.
Syntax
mask-composite : add | subtract | intersect | exclude | clear | copy | destination-atop | destination-in | destination-out | destination-over | source-atop | source-in | source-out | source-over | xor
Property values
subtract
-
The destination mask layer will be subtracted from the source layer and then only the remaining source layer is visible.
- Try it
mask-composite: subtract; exclude
-
It is opposite to that of 'intersect' i.e. the portions of both layers that don't intersect are visible.
- Try it
mask-composite: exclude; source-over
-
It places the source layer over the destination layer.
- Try it
mask-composite: source-over; destination-over
-
It places the destination layer over the source layer.
- Try it
mask-composite: destination-over; source-in
-
represents only the source area that overlaps the destination layer.
- Try it
mask-composite: source-in; destination-in
-
represents only the destination area that overlaps the source layer.
- Try it
mask-composite: destination-in; source-out
-
It represents the portion of source layer that falls outside the overlapping area.
- Try it
mask-composite: source-out; destination-out
-
It represents the portion of destination layer that falls outside the overlapping area.
- Try it
mask-composite: destination-out; source-atop
-
It represents both the overlapping area and destination area.
- Try it
mask-composite: source-atop; destination-atop
-
It represents both the overlapping area and source area.
- Try it
mask-composite: source-atop; xor
-
The non-overlapping regions of both the source and destination layers.
- Try it
mask-composite: xor;
Applicable to
It applies to all elements