CSS ล้น-xคุณสมบัติ
ตัวอย่าง
แสดงค่าคุณสมบัติ overflow-x ที่แตกต่างกัน:
div.ex1 {
overflow-x: scroll;
}
div.ex2 {
overflow-x: hidden;
}
div.ex3 {
overflow-x:
auto;
}
div.ex4 {
overflow-x: visible;
}
ความหมายและการใช้งาน
คุณสมบัติoverflow-x
ระบุว่าจะตัดเนื้อหา เพิ่มแถบเลื่อน หรือแสดงเนื้อหาล้นขององค์ประกอบระดับบล็อก เมื่อล้นที่ขอบด้านซ้ายและด้านขวา
เคล็ดลับ:ใช้คุณสมบัติoverflow-yเพื่อกำหนดการตัดที่ขอบด้านบนและด้านล่าง
ค่าเริ่มต้น: | มองเห็นได้ |
---|---|
รับการถ่ายทอด: | ไม่ |
เคลื่อนไหวได้: | ไม่. อ่านเกี่ยวกับแอนิเมชั่น |
รุ่น: | CSS3 |
ไวยากรณ์ JavaScript: | วัตถุ .style.overflowX="scroll" |
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนคุณสมบัติอย่างสมบูรณ์
Numbers ตามด้วย -ms- ระบุเวอร์ชันแรกที่ทำงานกับคำนำหน้า
Property | |||||
---|---|---|---|---|---|
overflow-x | 4.0 | 9.0 8.0 -ms- |
3.5 | 3.0 | 9.5 |
ไวยากรณ์ CSS
overflow-x: visible|hidden|scroll|auto|initial|inherit;
มูลค่าทรัพย์สิน
Value | Description | Play it |
---|---|---|
visible | The content is not clipped, and it may be rendered outside the left and right edges. This is default | |
hidden | The content is clipped - and no scrolling mechanism is provided | |
scroll | The content is clipped and a scrolling mechanism is provided | |
auto | Should cause a scrolling mechanism to be provided for overflowing boxes | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
หน้าที่เกี่ยวข้อง
กวดวิชา CSS: CSS ล้น
การอ้างอิง HTML DOM: คุณสมบัติ overflowX