xxxxxxxxxx
<div class="header">
Page <span class="pagenum"></span>
</div>
<div class="footer">
Page <span class="pagenum"></span>
</div>
xxxxxxxxxx
<html>
<head>
<style>
@page { margin: 100px 25px; }
header { position: fixed; top: -60px; left: 0px; right: 0px; background-color: lightblue; height: 50px; }
footer { position: fixed; bottom: -60px; left: 0px; right: 0px; background-color: lightblue; height: 50px; }
p { page-break-after: always; }
p:last-child { page-break-after: never; }
</style>
</head>
<body>
<header>header on each page</header>
<footer>footer on each page</footer>
<main>
<p>page1</p>
<p>page2></p>
</main>
</body>
</html>