指定页眉和页脚在打印时显示在每个页面上? [英] Specify header and footer to appear on every page when printed?
本文介绍了指定页眉和页脚在打印时显示在每个页面上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法指定文本出现在每页的底部和标题上?
或
是否有CSS解决方案可以在每个打印页面上重复页眉和页脚?
谢谢
< p class =print-this>文字将以印刷方式呈现< / p>
然后在您的print.css中
.print-this {
display:block;
}
和您的main.css中
.print-this {
display:none;
$ / code>
哦,你需要在你的样式表中包含媒体选项,正如Giu所说:
< link rel =stylesheettype =text / csshref =print.cssmedia =print />
< link rel =stylesheettype =text / csshref =main.cssmedia =screen/>
Is there a way to specify text to appear on the bottom and header of every page when printed?
or
Is there a CSS solution which would allow a header and footer to repeat on each printed page?
thank you
解决方案
Although your question is a bit too general, I'm assuming you want that specific text to appear only on your print page and not in your website. Just do a
<p class="print-this">TEXT TO BE SHOWN IN PRINT</p>
then in your print.css
.print-this {
display: block;
}
and in your main.css
.print-this {
display: none;
}
Oh and you need to include your stylesheet with the media option as Giu said:
<link rel="stylesheet" type="text/css" href="print.css" media="print" />
<link rel="stylesheet" type="text/css" href="main.css" media="screen" />
这篇关于指定页眉和页脚在打印时显示在每个页面上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文