我可以在每个页面上打印标题,但我是新手来打印边距.我认为@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>
Run Code Online (Sandbox Code Playgroud)