簡體   English   中英

Chrome打印預覽:每頁底部的任何文本

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

我正在設計一個報告頁面,卻迷失了這個問題。 有誰知道如何在要打印的每一頁的頁腳中放置任何文本?

我已經設法在最后一個或第一個上做到這一點。 但不是每一個

這是我的代碼

全頁預覽 (按Ctrl + P或Command + P)。

感謝您的所有建議!

這可能無濟於事,但是如果您知道報告的大小(高度不會改變),則可以嘗試執行以下操作。 使用@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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM