and
@media print {
h1,h2,h3,h4,h5,h6 {
page-break-before: always;
}
}
I use the following*, which can be inserted wherever needed;
or mostly equivalent, div.page-break {
page-break-after: always;
}
then
Edit:
*This works in markdown to pdf exports using pandoc. Other implementations may behave differerently.*
A somewhat mundane reason for the examples, you provided, and for these rules seldom seen in action may be that with websites, there's rarely substantial care invested in print layouts, anymore. (This used to be slightly different, when executives still used to interact with the Internet on a print-out-only basis and pages came with extensive, dedicated print style-sheets. Meaning, print was how your customers were probably experiencing their new website, as were their peers, so it was important. There are also possible, additional problems related to reflow and varying resources, esp. with JS-generated content.) In a way, "mobile first" also meant "print definitely last", since it's yet another layout to maintain.
[1] https://developer.mozilla.org/en-US/docs/Web/CSS/break-befor..., https://developer.mozilla.org/en-US/docs/Web/CSS/break-after, https://developer.mozilla.org/en-US/docs/Web/CSS/break-insid...
http://www.undr.com/understatement/2020/the_one_where_we_beg...
https://www.russellbeattie.com/notes/posts/we-need-an-html-d...