CSS Reference ยท Colors and Backgrounds
The print-color-adjust property
Reference for the CSS print-color-adjust property: make browsers print background colors and images exactly as designed, or let them save ink.
When a page is printed, browsers usually drop background colors and background images to save ink and keep text readable. The print-color-adjust property lets you say whether the browser may make that adjustment (economy) or must print the colors as written (exact).
Use exact for elements whose background is part of the meaning, such as table header shading, chart bars, status badges and colored progress indicators. Leave everything else alone.
.badge { print-color-adjust: exact; }
Try it
On screen both rows look the same. The difference only appears in print or print preview, and only when the user has not turned on "Background graphics" in the print dialog.
Syntax
print-color-adjust: economy | exact
- Initial value:
economy - Applies to: all elements
- Inherited: yes
- Animatable: no
- Computed value: as specified
Values
| Value | Description |
|---|---|
economy |
The browser may change colors, drop backgrounds and otherwise save ink or improve legibility. This is the default. |
exact |
The element is printed with the colors you specified, so backgrounds, gradients and background images appear on paper. |
Usage notes
- It only matters for printing (and print-like output such as saving to PDF). It has no effect on how the page looks on screen.
- Browsers may still let the user override it. Some print dialogs have their own "background graphics" checkbox, which can take priority over the page's request.
- Prefer to design for ink-free printing. Add real borders or text labels so the page still makes sense if backgrounds are dropped. Use
exactonly where color is essential. - Text color stays. Even in
economy, text normally prints in its own color; it is mostly backgrounds that disappear. - Prefixed form. Older Chromium and Safari versions used
-webkit-print-color-adjust. Many sites still write both lines, as in the example. Check a compatibility table to see whether you can drop the prefix. - Combine with a print stylesheet. The property is most useful inside
@media print { ... }when you want the exact look only on paper.
Browser support
Browsers have honored the prefixed -webkit-print-color-adjust for a long time, and the unprefixed property is supported in current releases of major browsers; check a compatibility table for the versions you need.
Related
@mediaโ theprintmedia type- Printing CSS โ print stylesheet techniques
@pageโ page size and marginsbackgroundโ the property most affected- Lesson: Print Styles