简体   繁体   English

Chrome打印预览:每页底部的任何文本

[英]Chrome print preview: any text on the bottom of every page

I'm designing a report pages and I've lost with this issue. 我正在设计一个报告页面,却迷失了这个问题。 Does anyone know how to put any text on the footer of every page being printed? 有谁知道如何在要打印的每一页的页脚中放置任何文本?

I've managed how to do it on the last one or on the first one. 我已经设法在最后一个或第一个上做到这一点。 But not every . 但不是每一个

This is code I have . 这是我的代码

Full-page preview (Press Ctrl+P or Command+P). 全页预览 (按Ctrl + P或Command + P)。

Thank you for your all advices! 感谢您的所有建议!

This probably wont help, but if you know the size of your reports (they dont change in height) you could try doing something like below. 这可能无济于事,但是如果您知道报告的大小(高度不会改变),则可以尝试执行以下操作。 Use an @media query to only display the ::after content when printing. 使用@media查询仅在打印时显示:: after内容。

http://jsbin.com/dabusal/1/edit?html,css,output http://jsbin.com/dabusal/1/edit?html,css,输出

 .report-page { page-break-inside: avoid; page-break-after:always; height:880px; position:relative; border:1px dashed; } .report-page.report-page--last { page-break-after: avoid; } .report-page::after { content:'Footer Content ©2016'; position:absolute; bottom:0; left:0; } 
 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>JS Bin</title> </head> <body> <div class='report-page'>PAGE1</div> <div class='report-page report-page--last'>PAGE2</div> </body> </html> 

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

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