失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > html图片按页码显示 html - 在打印html文档时显示页码 - 堆栈内存溢出

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

时间:2021-12-04 18:29:40

相关推荐

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文档时显示页码 - 堆栈内存溢出》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。