简体   繁体   English

使用计数器属性时如何将页码放在底部

[英]How to put page number in bottom when using counter property

I create page number that using counter property in css am trying to put it in the end of the page and I need to use pure css 我创建了使用CSS中的counter属性试图将其放在页面末尾的页码,我需要使用纯CSS

this is my CSS: 这是我的CSS:

@media print {
        table.break {
            page-break-after: left;
        }
        body {
            counter-reset: table;
        }
        table::after {
            counter-increment: table;
            content: "page"" "counter(table);
        }
        .no-print, .no-print * {
            display: none;
        }
    }
CSS
@page {
    @bottom {
    content: "Page " counter(page) " of " counter(pages)
    }
}

This rule will generate page footers such as "Page 1 of 89". 此规则将生成页脚,例如“ 89页中的第1页”。

For More Information 欲获得更多信息

http://www.princexml.com/doc/page-numbers/ http://www.princexml.com/doc/page-numbers/

https://stackoverflow.com/a/6109932/4513879 https://stackoverflow.com/a/6109932/4513879

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM