CSS ล้น-yคุณสมบัติ
ตัวอย่าง
แสดงค่าคุณสมบัติ overflow-y ที่แตกต่างกัน:
div.ex1 {
overflow-y: scroll;
}
div.ex2 {
overflow-y: hidden;
}
div.ex3 {
overflow-y:
auto;
}
div.ex4 {
overflow-y: visible;
}
ความหมายและการใช้งาน
คุณสมบัติoverflow-y
ระบุว่าจะตัดเนื้อหา เพิ่มแถบเลื่อน หรือแสดงเนื้อหาล้นขององค์ประกอบระดับบล็อก เมื่อล้นที่ขอบด้านบนและด้านล่าง
เคล็ดลับ:ใช้คุณสมบัติoverflow-xเพื่อกำหนดการตัดขอบด้านซ้ายและขวา
ค่าเริ่มต้น: | มองเห็นได้ |
---|---|
รับการถ่ายทอด: | ไม่ |
เคลื่อนไหวได้: | ไม่. อ่านเกี่ยวกับแอนิเมชั่น |
รุ่น: | CSS3 |
ไวยากรณ์ JavaScript: | วัตถุ .style.overflowY="scroll" |
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนคุณสมบัติอย่างสมบูรณ์
Numbers ตามด้วย -ms- ระบุเวอร์ชันแรกที่ทำงานกับคำนำหน้า
Property | |||||
---|---|---|---|---|---|
overflow-y | 4.0 | 9.0 8.0 -ms- |
1.5 | 3.0 | 9.5 |
ไวยากรณ์ CSS
overflow-y: visible|hidden|scroll|auto|initial|inherit;
มูลค่าทรัพย์สิน
Value | Description | Play it |
---|---|---|
visible | The content is not clipped, and it may be rendered outside the content box. 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: overflowY คุณสมบัติ