คุณสมบัติCSS โหมดมาสก์
ตัวอย่าง
ให้ภาพเลเยอร์มาสก์ได้รับการปฏิบัติเหมือนมาสก์ความส่องสว่าง:
.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;
}
ความหมายและการใช้งาน
คุณสมบัติmask-mode
ระบุว่าควรใช้ภาพเลเยอร์มาสก์เป็นมาสก์ luminance หรือเป็นมาสก์อัลฟ่า
ค่าเริ่มต้น: | จับคู่แหล่งที่มา |
---|---|
รับการถ่ายทอด: | ไม่ |
เคลื่อนไหวได้: | ไม่. อ่านเกี่ยวกับแอนิเมชั่น |
รุ่น: | CSS3 |
ไวยากรณ์ JavaScript: | วัตถุ .style.maskMode="alpha" |
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนคุณสมบัติอย่างสมบูรณ์
Property | |||||
---|---|---|---|---|---|
mask-mode | Not supported | Not supported | 53.0 | Not supported | Not supported |
ไวยากรณ์ CSS
mask-mode:
match-source|luminance|alpha|initial|inherit;
มูลค่าทรัพย์สิน
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 |
หน้าที่เกี่ยวข้อง
การอ้างอิง CSS: คุณสมบัติ mask-image
การอ้างอิง CSS: คุณสมบัติที่มาที่มาสก์
การอ้างอิง CSS: คุณสมบัติตำแหน่งมาสก์
การอ้างอิง CSS: คุณสมบัติ mask-repeat
การอ้างอิง CSS: คุณสมบัติขนาดมาสก์
กวดวิชา CSS: CSS Masking