我需要在 PDF 的每一页中应用页眉和页脚文本,因为我正在使用 CSS 的下面一行。这样我就可以在每一页中应用页眉文本,但不能应用页脚文本。我只在 PDF 的最后一页获得页脚文本。
@@page {
@@top {
content: element(header);
}
@@bottom {
content: element(footer);
}
}
header {
padding: 10px;
position: running(header);
}
footer {
padding: 5px;
position: running(footer);
}
最佳答案
#footer {
position: fixed;
width: 100%;
bottom: 0;
left: 0;
right: 0;
}
#footer p {
border-top: 2px solid #555555;
margin-top:10px;
}
<div id="footer">
<p>footer text</p>
</div>
关于css - 使用 CSS 在 PDF 的每一页中添加页脚文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30911886/