Are you wondering how to maintain the same background across multiple printed pages? You can achieve this by utilizing the @page
rule, which allows you to define the appearance of all printed pages. This feature is specified in the Paged Media Spec.
@page {
size: A4;
margin: 0.25in;
background: top left URL('myimg.png') no-repeat;
}
It's important to note that many browsers do not print background images by default. To override this behavior, you can try using -webkit-print-color-adjust: exact;
, but this method is non-standard and only compatible with webkit browsers.
If the background image is crucial for your printed output, a more effective approach could be to absolutely position an <img>
on each page and then use z-index
to place it behind other content.