Thuộc tính chế độ mặt nạ CSS
Thí dụ
Để hình ảnh lớp mặt nạ được coi là mặt nạ độ sáng:
.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;
}
Định nghĩa và Cách sử dụng
Thuộc mask-mode
tính chỉ định xem hình ảnh lớp mặt nạ nên được coi là mặt nạ độ sáng hay mặt nạ alpha.
Giá trị mặc định: | nguồn đối sánh |
---|---|
Thừa hưởng: | không |
Hoạt hình: | không. Đọc về hoạt hình |
Phiên bản: | CSS3 |
Cú pháp JavaScript: | đối tượng .style.maskMode = "alpha" |
Hỗ trợ trình duyệt
Các số trong bảng chỉ định phiên bản trình duyệt đầu tiên hỗ trợ đầy đủ thuộc tính.
Property | |||||
---|---|---|---|---|---|
mask-mode | Not supported | Not supported | 53.0 | Not supported | Not supported |
Cú pháp CSS
mask-mode:
match-source|luminance|alpha|initial|inherit;
Giá trị tài sản
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 |
Các trang liên quan
Tham chiếu CSS: thuộc tính mask-image
Tham chiếu CSS: thuộc tính mask-origin
Tham chiếu CSS: thuộc tính mask-position
Tham chiếu CSS: thuộc tính mask-repeat
Tham chiếu CSS: thuộc tính mask-size
Hướng dẫn CSS: CSS Masking