Oz Bar-Shalom Oz Bar-Shalom - 26 days ago 4
CSS Question

html - verify that each div will be on separated print page

I have many divs that proposed to be printed - on different pages.
How can I make sure that when the user is clicking the print button, each div will be on a different page?



You can use the page-break-after attribute in the print media query. The advantage is, that you don't have to change the size of your divs, it just makes sure that the page break will be after the div.

@media print {
    div {
        page-break-after: always;

More information about page-break-after on MDN.