CSS ตัวแบ่งหน้าก่อนคุณสมบัติ
ตัวอย่าง
แทรกตัวแบ่งหน้าก่อน <h1> องค์ประกอบเสมอ:
@media print
{
h1 {page-break-before: always;}
}
ความหมายและการใช้งาน
คุณสมบัติpage-break-before
เพิ่มตัวแบ่งหน้าก่อนองค์ประกอบที่ระบุ..
เคล็ดลับ:คุณสมบัติ: page-break-before, page-break-afterและ page-break-insideช่วยในการกำหนดว่าเอกสารควรทำงานอย่างไรเมื่อพิมพ์
หมายเหตุ: คุณไม่สามารถใช้คุณสมบัตินี้กับ <div> ที่ว่างเปล่าหรือองค์ประกอบที่มีตำแหน่งที่แน่นอนได้
ค่าเริ่มต้น: | รถยนต์ |
---|---|
รับการถ่ายทอด: | ไม่ |
เคลื่อนไหวได้: | ไม่. อ่านเกี่ยวกับแอนิเมชั่น |
รุ่น: | CSS2 |
ไวยากรณ์ JavaScript: | วัตถุ .style.pageBreakBefore="always" |
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนคุณสมบัติอย่างสมบูรณ์
Property | |||||
---|---|---|---|---|---|
page-break-before | 1.0 | 4.0 | 1.0 | 1.2 | 7.0 |
หมายเหตุ:ไม่มีเบราว์เซอร์ใดรองรับ "หลีกเลี่ยง"
หมายเหตุ:เบราว์เซอร์อาจตีความ "ซ้าย" และ "ขวา" เป็น "เสมอ"
ไวยากรณ์ CSS
page-break-before: auto|always|avoid|left|right|initial|inherit;
มูลค่าทรัพย์สิน
Value | Description |
---|---|
auto | Default. Automatic page-breaks |
always | Always insert a page-break before the element |
avoid | Avoid page-break before the element (if possible) |
left | Insert page-break before the element so that the next page is formatted as a left page |
right | Insert page-break before the element so that the next page is formatted as a right page |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
หน้าที่เกี่ยวข้อง
การอ้างอิง HTML DOM: คุณสมบัติ pageBreakBefore