html图片按页码显示,html - 在打印html文档时显示页码 - 堆栈内存溢出
幾個月前,當我使用以下代碼在瀏覽器(firefox)中打印HTML文檔時,能夠顯示頁碼:
body {
width: 300px;
counter-reset: page;
}
#header {
border: 1px solid;
overflow: hidden;
}
#header>div {
float: left;
width: 50%;
line-height: 100px;
text-align: center;
}
#foot {
border: 1px solid;
}
#header p {
margin: 0;
}
#header #pagenum {
border-left: 1px solid;
width: calc(50% - 1px);
}
@media print {
.pageBreak {
page-break-before: always;
padding-bottom: 120px;
}
#content {
padding-top: 120px;
}
#header {
display: block;
position: fixed;
top: 0pt;
left: 0pt;
right: 0pt;
}
.pagenum:after {
content: "Page " counter(page);
counter-increment: page;
}
#foot {
display: block;
position: fixed;
bottom: 0pt;
}
}
@media screen, handheld {
#header {
display: none;
}
#foot {
display: none;
}
}
Header
This is the page 1
This is the page 2
This is the page 3
This is the page 4
Foot Notes
可以在Firefox 45.7.0中使用。 由于最后一次Firefox更新幾個月后,它不再工作了。 我目前使用的是Firefox Quantum 69.0。 我的問題:1.是否不再受支持? 2.打印html文檔時,如何在每頁上顯示正確的頁碼?
最好的祝福
總結(jié)
以上是生活随笔為你收集整理的html图片按页码显示,html - 在打印html文档时显示页码 - 堆栈内存溢出的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: html5新增的js api,对HTML
- 下一篇: 老外大赞OPPO Find N2 Fli