当我打印或打印预览时,如何使用不同的CSS? [英] How can I have different CSS when I print or print preview?
本文介绍了当我打印或打印预览时,如何使用不同的CSS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想更改我的网页上的某些内容。我也想做一些隐藏的事情。有一种方法,我可以做到这一点与CSS,当我打印?
I'd like to change some things on my web page. Also I would like to make some things hidden. Is there a way I can do this with CSS when I print? In particular I want to be able to hide some DIVs and all that they contain.
推荐答案
这可以通过单独的打印来实现样式表。 media
属性是关键:
This can be achieved with a separate print stylesheet. The media
attribute is the key:
<link rel="stylesheet" type="text/css" href="print.css" media="print" />
这篇关于当我打印或打印预览时,如何使用不同的CSS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文