CSSmask-type Property
Example
Look at two SVG <mask> elements; one with mask-type alpha and one with mask-type luminance:
<defs>
<mask id="mask1" maskContentUnits="objectBoundingBox" style="mask-type:alpha">
<rect width="10" height="10" fill="red" fill-opacity="0.7" />
</mask>
<mask id="mask2" maskContentUnits="objectBoundingBox" style="mask-type:luminance">
<rect width="10" height="10" fill="red" fill-opacity="0.7" />
</mask>
</defs>
</svg>
Definition and Usage
Themask-type property specifies whether an SVG <mask> element is treated as a luminance mask or as an alpha mask.
This applies to the SVG <mask> element itself.
| Default value: | luminance |
|---|---|
| Inherited: | no |
| Animatable: | no.Read aboutanimatable |
| Version: | CSS Masking Module Level 1 |
| JavaScript syntax: | object.style.maskType="alpha" |
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
| Property | |||||
|---|---|---|---|---|---|
| mask-type | 24 | 79 | 35 | 7 | 15 |
CSS Syntax
Property Values
| Value | Description |
|---|---|
| luminance | Treat the mask image as a luminance mask. This is default. |
| alpha | Treat the mask image as an alpha mask |
| initial | Sets this property to its default value.Read aboutinitial |
| inherit | Inherits this property from its parent element.Read aboutinherit |
Related Pages
CSS reference:mask property
CSS reference:mask-clip property
CSS reference:mask-composite property
CSS reference:mask-image property
CSS reference:mask-mode property
CSS reference:mask-origin property
CSS reference:mask-position property
CSS reference:mask-repeat property
CSS reference:mask-size property
CSS tutorial:CSS Masking

