问题
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