带有 CSS/HTML 的页码 [英] Page numbers with CSS/HTML
本文介绍了带有 CSS/HTML 的页码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
一个有趣的用例出现在我们面前,我们要求在打印网站时,打印的副本有页眉和页脚,页脚内有页码.
An interesting use case has popped up for us, we are requiring that when we print a website the printed copy will have a page header and footer, and inside the footer the page number.
有人知道如何实现这一目标吗?
Anyone got any idea how to achieve this?
注意:浏览器版本可以是最新的,客户是其他网络开发者.
Note: Browser version can be the latest of anything, clients are other web developers.
推荐答案
取决于您所需的浏览器支持.
Depending on your required browser support.
@page {
@bottom-right {
content: counter(page) " of " counter(pages);
}
}
进一步阅读:
- http://www.w3.org/TR/css3-page/
- http://www.intelligrape.com/blog/2010/08/20/add-page-number-using-page-property-of-css/
- http://www.princexml.com/doc/6.0/page-numbers/
这篇关于带有 CSS/HTML 的页码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文