我可以在每一页上打印一个标题,但我是打印页边距的新手。我认为@page css 会起作用,但它似乎不会影响页边距。如果我在正文上设置边距,它在第一页上工作,但后续页面默认从顶部边距开始,将标题放在文本顶部。
<style>
.header {
position: fixed;
top: 0;
}
@page {
size: 11in 17in;
margin-left: 1in;
margin-right: 1in;
margin-top: 1in;
margin-bottom: 1in;
}
</style>
<body>
<span class=header>This is the header</span>
This is the text of the document. (repeat until I get to page 2)
</body>