Thuộc tính chế độ mặt nạ CSS
Ví dụ
Hãy để hình ảnh lớp mặt nạ được coi là mặt nạ độ chói:
.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;
}
Hãy tự mình thử »Định nghĩa và cách sử dụng
Thuộc mask-mode
chỉ định xem hình ảnh lớp mặt nạ nên được coi là mặt nạ độ chói hay mặt nạ alpha.
Giá trị mặc định: | nguồn phù hợp |
---|---|
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 |
Trang liên quan
Tham chiếu CSS: thuộc tính hình ảnh mặt nạ
Tham chiếu CSS: thuộc tính mặt nạ gốc
Tham chiếu CSS: thuộc tính vị trí mặt nạ
Tham chiếu CSS: thuộc tính lặp lại mặt nạ
Tham chiếu CSS: thuộc tính kích thước mặt nạ
Hướng dẫn CSS: Mặt nạ CSS