非標準
この機能は標準ではなく、標準化の予定もありません。公開されているウェブサイトには使用しないでください。ユーザーによっては使用できないことがあります。実装ごとに大きな差があることもあり、将来は振る舞いが変わるかもしれません。
-webkit-print-color-adjust
CSSプロパティは、プリント時に背景色・背景画像の表示を強制できるようにする、WebKitブラウザ上で使用できる非標準のCSSプロパティです。
/* キーワード値 */
-webkit-print-color-adjust: economy;
-webkit-print-color-adjust: exact;
/* グローバル値 */
-webkit-print-color-adjust: inherit;
-webkit-print-color-adjust: initial;
-webkit-print-color-adjust: unset;
構文
The -webkit-print-color-adjust
以下のいずれかの値を持ちます。
値
economy
- 初期値です。背景色・背景画像はユーザーが明示的にブラウザの設定で許可した場合のみプリントされます。
exact
- この値が適用された要素の背景色・背景画像を強制的にプリントします。ユーザーのプリント設定を上書きます。
例
/* 黒地に白文字でプリントする */
article {
-webkit-print-color-adjust: exact;
background: #222;
color: #eee;
}
仕様書
Not part of any specification yet, though there is a proposal in the CSSWG wiki to standardize it.
ブラウザー実装状況
BCD tables only load in the browser
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.
関連情報
- 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