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

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

问题描述

这个问题之前有人问过但该解决方案不适用于我的情况.我想确保打印某些背景图像,因为它们是页面不可或缺的一部分.(它们不是直接在页面中的图像,因为其中有几个被用作 CSS 精灵.)

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 精灵.

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.

除了创建带有内联图标的单独页面之外,还有其他解决方案吗?

Aside from creating a separate page with the icons inline, is there another solution?

推荐答案

您几乎无法控制浏览器的打印方法.您最多可以建议,但是如果浏览器的打印设置有不打印背景图像",那么您必须重写页面以将背景图像变成恰好位于其他内容后面的浮动前景"图像.

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天全站免登陆