欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

html图片按页码显示,html - 在打印html文档时显示页码 - 堆栈内存溢出

发布时间:2023/12/19 48 豆豆
生活随笔 收集整理的这篇文章主要介绍了 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文档时,如何在每页上显示正确的页码?

最好的祝福

总结

以上是生活随笔为你收集整理的html图片按页码显示,html - 在打印html文档时显示页码 - 堆栈内存溢出的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。