我有一个网络应用程序,它有一个可能超过一页的报告,我想在每一页中打印页眉和页脚。
我找到并尝试这个:在每页中重复报告标题 https://www.servoyforge.net/boards/2/topics/215?r=220#message-220但它对我不起作用。我尝试了 Opera,IE9,Firefox,Google Chrome,但是......什么都没有。页边距工作正常,但内容是我想要的,但它不起作用。
您可以设置一个position: fixed;
页眉和页脚,以便它在每一页上重复
例如
<header class="onlyprint"><!--Content Goes Here--></header>
<footer class="onlyprint"><!--Content Goes Here--></footer>
@media screen {
header.onlyprint, footer.onlyprint{
display: none; /* Hide from screen */
}
}
@media print {
header.onlyprint {
position: fixed; /* Display only on print page (each) */
top: 0; /* Because it's header */
}
footer.onlyprint {
position: fixed;
bottom: 0; /* Because it's footer */
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)