位置:运行(标题)是CSS中无效的属性值,当使用WKHTMLTOPDF将HTML转换为PDF时
我将一个可重复的标头和页脚设置为PDF文件。这是我的代码:
<style>
@page {
size: A4 landscape;
margin: 0.5cm;
@top-center {content: element(footer)}
@bottom-center {content: element(footer)}
}
.header {
position: running(header);
width: 100%;
}
.footer {
position: running(footer);
width: 100%;
}
</style>
<div class="header" id="headerContent" >
It's header
</div>
<div class="footer" id="footerContent">
It's footer
</div>
<main>
Content
</main>
但是,当我在转换为PDF之前预览HTML代码时,似乎位置:running(header);
不起作用。
我想我使用的版本不支持CSS中的此属性,但我不确定。
谁能帮我。 谢谢你!
I am setting a repeatable header and footer to the pdf file. Here is my code:
<style>
@page {
size: A4 landscape;
margin: 0.5cm;
@top-center {content: element(footer)}
@bottom-center {content: element(footer)}
}
.header {
position: running(header);
width: 100%;
}
.footer {
position: running(footer);
width: 100%;
}
</style>
<div class="header" id="headerContent" >
It's header
</div>
<div class="footer" id="footerContent">
It's footer
</div>
<main>
Content
</main>
But when I preview the HTML code before converting to pdf, it seems that position: running(header);
not working.
I guess that the version I used does not support this property in CSS, but I not sure.
Can anyone help me.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论