非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。

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

/* Keyword values */
-webkit-print-color-adjust: economy;
-webkit-print-color-adjust: exact;
/* Global values */
-webkit-print-color-adjust: inherit;
-webkit-print-color-adjust: initial;
-webkit-print-color-adjust: unset;
					

句法

-webkit-print-color-adjust property is specified as one of the keyword values listed below.

economy

Normal behavior.  Background colors and images are only printed if the user explicitly allows it in their browser's print settings dialog.

exact

Background colors and images of the element to which this rule is applied are always printed, user's print settings are overridden.

形式定义

Value not found in DB!

形式句法

Syntax not found in DB!
					

范例

Forcing white-on-black printing

article {
  -webkit-print-color-adjust: exact;
  background: #222;
  color: #eee;
}
					

规范

Not part of any standard, though there is a proposal in the CSSWG wiki to standardize it.

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
-webkit-print-color-adjust 非标 Chrome 完整支持 17 注意事项
完整支持 17 注意事项
注意事项 Chrome does not print backgrounds of the <body> element. If this property is set to exact <body> element, it will apply only to its descendants.
注意事项 Before Chrome 26, if background images are clipped (for example, when using background-image sprites) and -webkit-print-color-adjust is set to exact , then backgrounds will appear distorted when printed. Solid backgrounds and background images that are not clipped (i.e., backgrounds that have narrower and shorter than the element to which they are applied) are printed correctly. See Chromium bug 131054 .
Edge 完整支持 79 注意事项
完整支持 79 注意事项
注意事项 Edge does not print backgrounds of the <body> element. If this property is set to exact <body> element, it will apply only to its descendants.
Firefox 不支持 No IE 不支持 No Opera 完整支持 15 注意事项
完整支持 15 注意事项
注意事项 Opera does not print backgrounds of the <body> element. If this property is set to exact <body> element, it will apply only to its descendants.
Safari 完整支持 6 注意事项
完整支持 6 注意事项
注意事项 Safari does not print backgrounds of the <body> element. If this property is set to exact <body> element, it will apply only to its descendants.
WebView Android 完整支持 37 注意事项
完整支持 37 注意事项
注意事项 WebView does not print backgrounds of the <body> element. If this property is set to exact <body> element, it will apply only to its descendants.
Chrome Android 完整支持 18 注意事项
完整支持 18 注意事项
注意事项 Chrome does not print backgrounds of the <body> element. If this property is set to exact <body> element, it will apply only to its descendants.
注意事项 Before Chrome 26, if background images are clipped (for example, when using background-image sprites) and -webkit-print-color-adjust is set to exact , then backgrounds will appear distorted when printed. Solid backgrounds and background images that are not clipped (i.e., backgrounds that have narrower and shorter than the element to which they are applied) are printed correctly. See Chromium bug 131054 .
Firefox Android 不支持 No Opera Android 完整支持 15 注意事项
完整支持 15 注意事项
注意事项 Opera does not print backgrounds of the <body> element. If this property is set to exact <body> element, it will apply only to its descendants.
Safari iOS 完整支持 6 注意事项
完整支持 6 注意事项
注意事项 Safari does not print backgrounds of the <body> element. If this property is set to exact <body> element, it will apply only to its descendants.
Samsung Internet Android 完整支持 1.0 注意事项
完整支持 1.0 注意事项
注意事项 Samsung Internet does not print backgrounds of the <body> element. If this property is set to exact <body> element, it will apply only to its descendants.
注意事项 Before Chrome 26, if background images are clipped (for example, when using background-image sprites) and -webkit-print-color-adjust is set to exact , then backgrounds will appear distorted when printed. Solid backgrounds and background images that are not clipped (i.e., backgrounds that have narrower and shorter than the element to which they are applied) are printed correctly. See Chromium bug 131054 .

图例

完整支持

完整支持

不支持

不支持

非标。预期跨浏览器支持较差。

非标。预期跨浏览器支持较差。

见实现注意事项。

见实现注意事项。

另请参阅

  • WebKit bug 64583 : "WIP: Add CSS property to control printing of backgrounds for individual elements"
  • CSSWG wiki: print-backgrounds - a proposal to standardize this property
  • CSS Color Module Level 4:  the color-adjust property - a newer proposal to standardize this property

元数据

  • 最后修改:
  1. CSS
  2. CSS 参考

Copyright  © 2014-2026 乐数软件    

工业和信息化部: 粤ICP备14079481号-1