Print css backgrounds in safari/chrome?

筅森魡賤 提交于 2019-12-22 04:05:22

问题


I need to print some pages with CSS backgrounds but they don't appear in Safari or Chrome, in FF there's an option in Page Setup but I haven't been able to find it in these two browsers. Do they not support it?

Thanks all in advance.


回答1:


Printing background images is a browser-dependent feature. FF and IE have it but you cannot force it otherwise via sourcecode.




回答2:


In chrome (newer versions 17+ I think), this is controlled by a CSS property on the items which developers can add:

-webkit-print-color-adjust:exact;

From the user's point of view, there doesn't seem to be an option for this.




回答3:


With the newest Chrome, that is an option.

You can also just take a screen shot and print the bitmap image in an image editor or paste the screen shot in Word to print.

Chrome Version 69.0.3497.100 (Official Build) (64-bit)




回答4:


I had this issue again, it was the Twitter Bootstrap CSS causing the issue. When I stopped using Bootstrap, the issue was resolved without any need for the special CSS property (-webkit-print-color-adjust:exact;).



来源:https://stackoverflow.com/questions/5355117/print-css-backgrounds-in-safari-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!