สไตล์คลิปคุณสมบัติ
ตัวอย่าง
คลิปรูปภาพเป็นรูปร่างที่ระบุ:
document.getElementById("myImg").style.clip = "rect(0px 75px 75px 0px)";
ความหมายและการใช้งาน
ชุดคุณสมบัติคลิปหรือส่งคืนว่าส่วนใดขององค์ประกอบตำแหน่งที่มองเห็นได้
รองรับเบราว์เซอร์
Property | |||||
---|---|---|---|---|---|
clip | Yes | Yes | Yes | Yes | Yes |
ไวยากรณ์
คืนคุณสมบัติของคลิป:
object.style.clip
ตั้งค่าคุณสมบัติของคลิป:
object.style.clip = "auto|rect(top right bottom left)|initial|inherit"
มูลค่าทรัพย์สิน
Value | Description |
---|---|
auto | Default. The element does not clip |
rect(top right bottom left) | Clips the shape defined by the four coordinates |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
รายละเอียดทางเทคนิค
ค่าเริ่มต้น: | รถยนต์ |
---|---|
คืนมูลค่า: | สตริงที่แสดงถึงส่วนขององค์ประกอบตำแหน่งที่มองเห็นได้ |
เวอร์ชัน CSS | CSS2 |
ตัวอย่างเพิ่มเติม
ตัวอย่าง
คืนคุณสมบัติของคลิป:
alert(document.getElementById("myImg").style.clip);
หน้าที่เกี่ยวข้อง
กวดวิชา CSS: การจัดตำแหน่ง CSS
การอ้างอิง CSS: คุณสมบัติคลิป
❮ สไตล์วัตถุ