Właściwość trybu maski CSS
Przykład
Niech obraz warstwy maski będzie traktowany jako maska luminancji:
.mask1 {
-webkit-mask-image: url(w3logo.png);
mask-image: url(w3logo.png);
-webkit-mask-size: 70%;
mask-size: 70%;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
mask-mode: luminance;
}
Definicja i użycie
Właściwość mask-mode
określa, czy obraz warstwy maski ma być traktowany jako maska luminancji, czy jako maska alfa.
Domyślna wartość: | źródło dopasowania |
---|---|
Dziedziczny: | nie |
Animowalny: | nie. Przeczytaj o animacji |
Wersja: | CSS3 |
Składnia JavaScript: | obiekt .style.maskMode="alfa" |
Obsługa przeglądarki
Liczby w tabeli określają pierwszą wersję przeglądarki, która w pełni obsługuje tę właściwość.
Property | |||||
---|---|---|---|---|---|
mask-mode | Not supported | Not supported | 53.0 | Not supported | Not supported |
Składnia CSS
mask-mode:
match-source|luminance|alpha|initial|inherit;
Wartości nieruchomości
Value | Description |
---|---|
match-source | If the mask-image property is an image (an image URL or a gradient), set mask-mode to alpha. If the mask-image property is an SVG <mask> element, use the <mask> element's mask-type property. This is default. |
luminance | Use the luminance values of the mask image as the mask values |
alpha | Use the alpha values of the mask image as the mask values |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Powiązane strony
Odniesienie CSS: właściwość mask-image
Dokumentacja CSS: właściwość mask-origin
Dokumentacja CSS: właściwość mask-position
Odniesienie CSS: właściwość mask-repeat
Dokumentacja CSS: właściwość rozmiaru maski
Samouczek CSS: Maskowanie CSS