I'm printing a long HTML document and i want to set the margin between the pages in the CSS file. Unfortunately, the padding/margin only take effect in the first page (padding-top) and the last page (padding-bottom).
Any way to set the margin between pages?
It's not margin between pages but page margin. It's controlled by a specific CSS media @page
:
@page {
margin: 1cm;
}
Please refer to linked specs for all the details (especially about how @page
combines with, for example, <body>
margins).
Note that with pseudo-selectors you can control the aspect of :left
, :right
and :first
pages (just to mention few common use cases).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With