สไตล์ชัดเจนคุณสมบัติ
ตัวอย่าง
ห้ามวัตถุลอยทางด้านซ้ายของข้อความในองค์ประกอบ:
document.getElementById("demo").style.clear = "left";
ความหมายและการใช้งาน
คุณสมบัติที่ชัดเจนตั้งค่าหรือส่งคืนตำแหน่งขององค์ประกอบที่สัมพันธ์กับวัตถุลอย
รองรับเบราว์เซอร์
Property | |||||
---|---|---|---|---|---|
clear | Yes | Yes | Yes | Yes | Yes |
ไวยากรณ์
คืนทรัพย์สินที่ชัดเจน:
object.style.clear
ตั้งค่าคุณสมบัติที่ชัดเจน:
object.style.clear = "none|left|right|both|initial|inherit"
มูลค่าทรัพย์สิน
Value | Description |
---|---|
none | Allows floating objects on both sides of the element. This is default |
left | No floating objects allowed on the left side of the element |
right | No floating objects allowed on the right side of the element |
both | No floating objects allowed on either the left or right side of the element |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
รายละเอียดทางเทคนิค
ค่าเริ่มต้น: | ไม่มี |
---|---|
คืนมูลค่า: | สตริง แทนตำแหน่งขององค์ประกอบที่สัมพันธ์กับวัตถุลอยตัว |
เวอร์ชัน CSS | CSS1 |
ตัวอย่างเพิ่มเติม
ตัวอย่าง
คืนทรัพย์สินที่ชัดเจน:
alert(document.getElementById("demo").style.clear);
หน้าที่เกี่ยวข้อง
กวดวิชา CSS: CSS Float
การอ้างอิง CSS: ล้างคุณสมบัติ
❮ สไตล์วัตถุ