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;

}

}

This is the page 1

This is the page 2

This is the page 3

This is the page 4

可以在Firefox 45.7.0中使用。 由于最后一次Firefox更新几个月后,它不再工作了。 我目前使用的是Firefox Quantum 69.0。 我的问题:1.是否不再受支持? 2.打印html文档时,如何在每页上显示正确的页码?

最好的祝福

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值