Strona stylu Przerwa przed właściwością
Przykład
Zawsze ustawiaj podział strony przed każdym elementem <p> z id="footer":
document.getElementById("footer").style.pageBreakBefore = "always";
Spróbuj sam "
Definicja i użycie
Właściwość pageBreakBefore ustawia lub zwraca zachowanie podziału strony przed elementem (w przypadku drukowania lub podglądu wydruku).
Uwaga: Właściwość pageBreakBefore nie ma wpływu na elementy pozycjonowane bezwzględnie. Podział strony jest widoczny tylko w podglądzie wydruku lub podczas drukowania.
Obsługa przeglądarki
Property | |||||
---|---|---|---|---|---|
pageBreakBefore | Yes | Yes | Yes | Yes | Yes |
Składnia
Zwróć właściwość pageBreakBefore:
object.style.pageBreakBefore
Ustaw właściwość pageBreakBefore:
object.style.pageBreakBefore = "auto|always|avoid|emptystring|left|right|initial|inherit"
Wartości nieruchomości
Value | Description |
---|---|
auto | Insert a page break before the element if necessary. This is default |
always | Always insert a page break before the element |
avoid | Avoid a page break before the element |
"" (empty string) | Page break is not inserted before the element |
left | Insert one or two page breaks before the element, so the next page is considered a left page |
right | Insert one or two page breaks before 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 |
Szczegóły techniczne
Domyślna wartość: | automatyczny |
---|---|
Wartość zwrotu: | String, reprezentujący zachowanie podziału strony przed elementem podczas drukowania |
Wersja CSS | CSS2 |
Powiązane strony
Odniesienie CSS: page-break-before property
❮ Obiekt stylu