CSS ล้างคุณสมบัติ
ตัวอย่าง
<p> องค์ประกอบถูกผลักด้านล่างซ้ายองค์ประกอบลอย (องค์ประกอบ <p> ไม่อนุญาตให้องค์ประกอบลอยทางด้านซ้าย):
img
{
float: left;
}
p.clear
{
clear: left;
}
ความหมายและการใช้งาน
คุณสมบัติclear
ควบคุมโฟลว์ถัดจากองค์ประกอบที่ลอยอยู่
คุณสมบัติclear
ระบุสิ่งที่ควรเกิดขึ้นกับองค์ประกอบที่อยู่ถัดจากองค์ประกอบลอย
เคล็ดลับ:ดูทรัพย์สินด้วย
float
ค่าเริ่มต้น: | ไม่มี |
---|---|
รับการถ่ายทอด: | ไม่ |
เคลื่อนไหวได้: | ไม่. อ่านเกี่ยวกับแอนิเมชั่น |
รุ่น: | CSS1 |
ไวยากรณ์ JavaScript: | วัตถุ .style.clear="ทั้งสอง" |
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนคุณสมบัติอย่างสมบูรณ์
Property | |||||
---|---|---|---|---|---|
clear | 1.0 | 5.0 | 1.0 | 1.0 | 6.0 |
ไวยากรณ์ CSS
clear: none|left|right|both|initial|inherit;
มูลค่าทรัพย์สิน
Value | Description |
---|---|
none | Default. The element is not pushed below left or right floated elements |
left | The element is pushed below left floated elements |
right | The element is pushed below right floated elements |
both | The element is pushed below both left and right floated elements |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
หน้าที่เกี่ยวข้อง
กวดวิชา CSS: CSS Float
การอ้างอิง HTML DOM: คุณสมบัติที่ชัดเจน