Properti mode topeng CSS
Contoh
Biarkan gambar lapisan topeng diperlakukan sebagai topeng luminance:
.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;
}
Definisi dan Penggunaan
Properti mask-mode
menentukan apakah gambar lapisan topeng harus diperlakukan sebagai topeng luminance atau sebagai topeng alfa.
Nilai bawaan: | sumber pertandingan |
---|---|
Diwarisi: | tidak |
Animasi: | tidak. Baca tentang animasi |
Versi: kapan: | CSS3 |
Sintaks JavaScript: | objek .style.maskMode="alpha" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Property | |||||
---|---|---|---|---|---|
mask-mode | Not supported | Not supported | 53.0 | Not supported | Not supported |
Sintaks CSS
mask-mode:
match-source|luminance|alpha|initial|inherit;
Nilai properti
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 |
Halaman Terkait
Referensi CSS: properti mask-image
Referensi CSS: properti mask-origin
Referensi CSS: properti mask-position
Referensi CSS: properti mask-repeat
Referensi CSS: properti ukuran topeng
Tutorial CSS: Penyamaran CSS