How to add headers and footers to each page of a printed HTML document?
P粉256487077
2023-08-20 14:58:06
<p>Is it possible to print a custom header and footer HTML page on every printed page? </p>
<p>I would like to add the words "UNCLASSIFIED" in red, Arial font, 16pt size, to the top and bottom of every printed page, regardless of content. </p>
<p>To clarify, if the document is printed to 5 pages, each page should have custom headers and footers. </p>
<p>Does anyone know if this can be achieved using HTML/CSS? </p>
If you want to set the element you want to be a footer to position:fixed and bottom:0, when the page prints, it will repeat the element at the bottom of every printed page. For the header element, just set top:0.
For example:
CSS: