CSS Paged Media Contents Issue

我是研究僧i 提交于 2020-01-16 06:48:29

问题


when printing HTML page I want to put custom text in header an all printed pages

@page {
    margin-top:5mm;
    margin-bottom: 25mm;
    margin-left: 30mm;
    margin-right: 30mm;

    @top-right{
        content: "Page title"; /* page title + current page count */
    }
}

While printing, the "Page Title: pageCount" does not appear neither in IE nor in any other browsers.. What am I doing wrong? Margins do work, but not the @top-right.


回答1:


I think the issue is that there is no browser support for @top-right and the other page margin boxes.

If rendering the content to a PDF prior to printing is an option for you, the Prince PDF generator appears to support margin boxes.

http://en.wikipedia.org/wiki/Comparison_of_layout_engines_(Cascading_Style_Sheets)#Grammar_and_rules



来源:https://stackoverflow.com/questions/21929881/css-paged-media-contents-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!