如何强制浏览器在CSS中打印背景图片? [英] How can I force browsers to print background images in CSS?

查看:656
本文介绍了如何强制浏览器在CSS中打印背景图片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题之前被问过但解决方案不适用于我的情况。我想确保打印某些背景图片,因为它们是页面的整体。 (它们不是直接在页面中的图像,因为它们中有几个被用作CSS sprites。)

This question was asked before but the solution is not applicable in my case. I want to make sure certain background images are printed because they are integral to the page. (They are not images directly in the page because there are several of them being used as CSS sprites.)

同一问题的另一个解决方案建议使用 list-style-image ,只有在每个图标都有不同的图片,而没有CSS sprites的情况下,它才有效。

Another solution on that same question suggests using list-style-image, which only works if you have a different image for every icon, no CSS sprites possible.

推荐答案

您对浏览器的打印方法几乎没有控制权。最多你可以SUGGEST,但如果浏览器的打印设置有不打印背景图片,没有什么你可以做没有重写页面,将背景图片变成浮动的前景图像,恰巧在其他内容后面。

You have very little control over a browser's printing methods. At most you can SUGGEST, but if the browser's print settings have "don't print background images", there's nothing you can do without rewriting your page to turn the background images into floating "foreground" images that happen to be behind other content.

这篇关于如何强制浏览器在CSS中打印背景图片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆