添加CSS打印页脚

时间:2015-01-26 11:55:24

标签: css css3

我正在尝试调试当我打印页面时@bottom-right@bottom-left无效的原因。相反,我目前得到chromes默认页脚,我无法弄清楚如何检查规则,看看它们是否被应用。

<style type="text/css">
    @page {
        size: A4;
        margin: 2cm;

        @bottom-right {
            content: counter(page) ' of ' counter(pages);
        }
        @bottom-left {
            content: '©  ' attr(data-date);
        }
    }

    @media print {
        html, body {
            width: 210mm;
            height: 297mm;
        }
    }
</style>

谢谢!

0 个答案:

没有答案