Dealing with page breaks

Forcing a page break

The simplest way to force a page break to happen is using CSS. You can use the page-break-before property to define a class like this:
CSS
1
.page-break {
2
page-break-before: always;
3
}
Copied!
You can then apply this class to any element you want to insert a page break before.

Preventing a page break

If you want to avoid a section of your document from being broken between pages, you can use the page-break-inside CSS property to do so:
CSS
1
.avoid-page-break {
2
page-break-inside: avoid;
3
}
Copied!
If you apply this class to an element, it will have no effect for an element that is in the middle of the page but if it risks being broken between two pages, it will insert a page break before it.