@media print {
p {
page-break-inside: avoid;
}
h1 {
page-break-before: always;
}
h2 {
page-break-after: avoid;
}
}
This code does 3 things:
it prevents a page break inside any p tags, meaning a paragraph will never be broken in two pages, if possible.
it for...