span.lot_number_text{
-webkit-print-color-adjust: exact;
color:#a94442;
padding-left:10px;
color-adjust: exact;
}
它总是显示黑色文本而不是我声明的颜色。我该如何解决这个问题?
最佳答案
引自MDN article (强调我的)
The
-webkit-print-color-adjust
property is a non-standard CSS extension that can be used to force printing of background colors and images in browsers based on the WebKit engine.
exact
Background colors and images of the element to which this rule is applied are always printed, user's print settings are overridden.
所以这意味着这只会影响背景颜色和图像,不会影响 color
。
这意味着仅 Chrome 的“背景图形”选项(在“更多设置”下拉菜单下可用) 正在被覆盖。
“颜色:黑色和白色”不能被该属性覆盖。
关于css - -webkit-print-color-adjust 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51433687/