css媒体类型打印使用铬中的背景颜色 [英] css media type print using background-color in chrome
问题描述
我使用CSS 媒体类型列印中的背景颜色
属性。
问题是Google Chrome在打印预览中不显示 background-color
或 background-image
。<
Chrome支持控制背景颜色/通过CSS进行图像打印。您可以在要打印其背景的元素上设置以下CSS属性:
-webkit-print-color-adjust:
通常情况下,这是由浏览器设置决定的,但Chrome允许网页设计师确定背景
- 需要Chrome 17或更高版本。
- 不打印正文标签的背景。
到Cron的网络技术博客,我第一次发现它: -
http://blog.crondesign.com/2011/11/print-css-backgrounds-in-google-chrome.html
此外,这导致一些背景信息(不需要双关语): -
http://code.google.com/p/chromium/issues/detail?id=107763
希望这有助于...
I am using the background-color
property in CSS media type print.
The problem is that Google Chrome does not show background-color
or background-image
in print preview.
How can this be solved?
Chrome supports control of background colour / image printing via CSS. You can set the following CSS property on elements whose background should be printed:
-webkit-print-color-adjust: exact;
Normally of course, this is determined by browser settings - but Chrome allows web designers to determine how backgrounds are printed on a per-element basis...
Notes:
- Requires Chrome 17 or higher.
- The background of the body tag is not printed.
Thanks to Cron’s Web Tech Blog, where I first spotted it:-
http://blog.crondesign.com/2011/11/print-css-backgrounds-in-google-chrome.html
Also, this leads to some background (no pun intended!) info regarding the feature:-
http://code.google.com/p/chromium/issues/detail?id=107763
Hope this helps...
这篇关于css媒体类型打印使用铬中的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!