Trang định kiểuBreakAfter thuộc tính
Thí dụ
Luôn đặt ngắt trang sau mỗi phần tử <p> với id = "footer":
document.getElementById("footer").style.pageBreakAfter = "always";
Hãy tự mình thử »
Định nghĩa và Cách sử dụng
Thuộc tính pageBreakAfter đặt hoặc trả về hành vi ngắt trang sau một phần tử (để in hoặc xem trước bản in).
Lưu ý: Thuộc tính pageBreakAfter không ảnh hưởng đến các phần tử được định vị tuyệt đối. Ngắt trang chỉ hiển thị trong bản xem trước khi in hoặc khi in.
Hỗ trợ trình duyệt
Property | |||||
---|---|---|---|---|---|
pageBreakAfter | Yes | Yes | Yes | Yes | Yes |
Cú pháp
Trả lại trang thuộc tínhBreakAfter:
object.style.pageBreakAfter
Đặt thuộc tính pageBreakAfter:
object.style.pageBreakAfter = "auto|always|avoid|emptystring|left|right|initial|inherit"
Giá trị tài sản
Value | Description |
---|---|
auto | Insert a page break after the element if necessary. This is default |
always | Always insert a page break after the element |
avoid | Avoid a page break after the element |
"" (empty string) | Page break is not inserted after the element |
left | Insert one or two page breaks after the element, so the next page is considered a left page |
right | Insert one or two page breaks after the element, so the next page is considered 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 |
Chi tiết kỹ thuật
Giá trị mặc định: | Tự động |
---|---|
Giá trị trả lại: | Chuỗi, đại diện cho hành vi ngắt trang sau một phần tử khi in |
Phiên bản CSS | CSS2 |
Các trang liên quan
Tham chiếu CSS: thuộc tính page-break-after
❮ Đối tượng phong cách