[英]Chrome print preview: any text on the bottom of every page
這可能無濟於事,但是如果您知道報告的大小(高度不會改變),則可以嘗試執行以下操作。 使用@media查詢僅在打印時顯示:: after內容。
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.