Properti ukuran topeng CSS
Contoh
Atur ukuran (dalam persen) untuk gambar layer mask:
.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;
}
Lebih banyak contoh "Coba Sendiri" di bawah ini.
Definisi dan Penggunaan
Properti mask-size
menentukan ukuran gambar lapisan topeng.
Nilai bawaan: | mobil |
---|---|
Diwarisi: | tidak |
Animasi: | tidak. Baca tentang animasi |
Versi: kapan: | CSS3 |
Sintaks JavaScript: | objek .style.maskSize="100px 200px" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Angka diikuti oleh -webkit- menentukan versi pertama yang berfungsi dengan awalan.
Property | |||||
---|---|---|---|---|---|
mask-image | 4.0 -webkit- | 79.0 -webkit- | 53.0 | 4.0 -webkit- | 15.0 -webkit- |
Sintaks CSS
mask-image: auto|size|contain|cover|initial|inherit;
Nilai properti
Value | Description |
---|---|
auto | This is default |
size | Specifies the size of the mask image in px, em, etc, or in % |
contain | Scales the mask image in a way that both its width and its height fit inside the container |
cover | Scales the mask image in a way that both its width and its height cover the container |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Lebih Banyak Contoh
Contoh
Atur ukuran (dalam piksel) untuk gambar lapisan topeng:
.mask1 {
-webkit-mask-image: url(w3logo.png);
mask-image: url(w3logo.png);
-webkit-mask-size: 200px 200px;
mask-size: 200px 200px;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
}
Halaman Terkait
Referensi CSS: properti mask-image
Referensi CSS: properti mode topeng
Referensi CSS: properti mask-origin
Referensi CSS: properti mask-position
Referensi CSS: properti mask-repeat
Tutorial CSS: Penyamaran CSS