คุณสมบัติ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-size
ระบุขนาดของภาพเลเยอร์มาสก์
ค่าเริ่มต้น: | รถยนต์ |
---|---|
รับการถ่ายทอด: | ไม่ |
เคลื่อนไหวได้: | ไม่. อ่านเกี่ยวกับแอนิเมชั่น |
รุ่น: | CSS3 |
ไวยากรณ์ JavaScript: | วัตถุ .style.maskSize="100px 200px" |
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนคุณสมบัติอย่างสมบูรณ์
Numbers ตามด้วย -webkit- ระบุเวอร์ชันแรกที่ทำงานกับคำนำหน้า
Property | |||||
---|---|---|---|---|---|
mask-image | 4.0 -webkit- | 79.0 -webkit- | 53.0 | 4.0 -webkit- | 15.0 -webkit- |
ไวยากรณ์ CSS
mask-image: auto|size|contain|cover|initial|inherit;
มูลค่าทรัพย์สิน
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 |
ตัวอย่างเพิ่มเติม
ตัวอย่าง
กำหนดขนาด (เป็นพิกเซล) สำหรับภาพเลเยอร์มาสก์:
.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;
}
หน้าที่เกี่ยวข้อง
การอ้างอิง CSS: คุณสมบัติ mask-image
การอ้างอิง CSS: คุณสมบัติโหมดมาสก์
การอ้างอิง CSS: คุณสมบัติที่มาที่มาสก์
การอ้างอิง CSS: คุณสมบัติตำแหน่งมาสก์
การอ้างอิง CSS: คุณสมบัติ mask-repeat
กวดวิชา CSS: CSS Masking