在 Firefox 中,当我按 Ctrl+p 以 Red Color
打印内容 Thumb
图标时,Thumb
图标打印在 中黑色
,你能帮帮我吗?
@media print {
body {
-webkit-print-color-adjust: exact;
}
}
.inner {
position: relative;
z-index: 2;
}
#wrap:after {
content: "\f087";
font-family: FontAwesome;
font-style: normal;
font-weight: normal;
text-decoration: inherit;
position: absolute;
font-size: 40px;
color: #ff2d00;
z-index: 1;
}
<HTML>
<head>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrap">
<div class="inner">
</div>
</div>
</body>
</HTML>
最佳答案
我没有要测试的彩色打印,但基于规范。你能试试改成这个吗
@媒体打印{
* {
-webkit-print-color-adjust:准确;
打印机颜色:准确!重要;
颜色调整:准确!重要;
}
}
引用:https://wiki.csswg.org/ideas/print-backgrounds
支持:Chrome、Firefox、Safari
关于html - 当我们按 Ctrl+P 时,CSS 的内容颜色在 Firefox 打印机上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52421374/