我遇到的问题是在打印页面上正确地将Firefox的过滤器css属性设置为灰度.出于某种原因,灰度图像在打印输出上不可见,尽管它在屏幕上显示为预期的.在提到像这样的问题后,我已经达到了这一点(简化以证明问题):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<style type="text/css">
.grayscale {
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+ */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(100%); /* Chrome 19+ & Safari 6+ */
filter: grayscale(100%);
}
img {
width:100px;
}
</style>
</head>
<body>
<img class="grayscale" src="http://alltheragefaces.com/img/faces/png/rage-nuclear.png" />
<img src="http://alltheragefaces.com/img/faces/png/rage-nuclear.png" />
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
这是 …