打印的样式表,忽略背景颜色 [英] Stylesheet for printing, background-color ignored

查看:124
本文介绍了打印的样式表,忽略背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建一个表,其中我在给每个tr类odd和even之间循环。在我的样式表中,我有这个:

I create a table where I cycle between giving each tr the class "odd" and "even". In my stylesheet I've got this:


table tbody tr.odd {
    background-color: #cccccc;
}

这从浏览器工作,但不是在打印时。

This works from the browser but not when printing. Everything else in my media stylesheet works except this background-color.

我的媒体样式表中的其他内容都有效,除了这种背景颜色。

I have colors enabled for printing, I can print images with colors... so?

推荐答案

默认情况下,大多数浏览器在打印时会忽略CSS背景颜色和图像。这只能通过更改浏览器中的设置来覆盖,如果浏览器甚至有这样的选项(一些不,像昆汀指出)。

By default, most browsers ignore CSS background colours and images when printing. This can only be overridden by changing the setting in the browser, if the browser even has such an option (some don't, as Quentin points out).

这篇关于打印的样式表,忽略背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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