For finer tuning of your PDF, you can try to force page breaks or avoid them. The renderer will try to follow your settings, but it's not always possible to avoid or force a break in the spot you desire.
page-break-before
, page-break-after
, page-break-inside
let you provide suggestions to the render, with CSS like this:
.chapter { page-break-before: always; }
.heading { page-break-after: avoid; }
section { page-break-inside: avoid; }
These properties can be applied to block-level elements, table rows and table row groups.
only accepts
page-break-insideavoid
as a value, but page-break-before
and page-break-after
also accept always
as a value. The default value is auto
for all three properties.