print-color-adjust
Quick Summary for color-adjust
The print-color-adjust CSS property sets what, if anything, the user agent may do to optimize the appearance of the element on the output device. By default, the browser is allowed to make any adjustments to the element's appearance it determines to be necessary and prudent given the type and capabilities of the output device.
Code Usage for color-adjust
print-color-adjust: economy; print-color-adjust: exact;  /* Global values */ print-color-adjust: inherit; print-color-adjust: initial; print-color-adjust: revert; print-color-adjust: unset; 
More Details for color-adjust

print-color-adjust

The print-color-adjust CSS property sets what, if anything, the user agent may do to optimize the appearance of the element on the output device. By default, the browser is allowed to make any adjustments to the element's appearance it determines to be necessary and prudent given the type and capabilities of the output device.

Syntax

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

The print-color-adjust property's value must be one of the following keywords.

Values

economy

The user agent is allowed to make adjustments to the element as it deems appropriate and prudent in order to optimize the output for the device it's being rendered for. For example, when printing, a browser might opt to leave out all background images and to adjust text colors to be sure the contrast is optimized for reading on white paper. This is the default.

exact

The element's content has been specifically and carefully crafted to use colors, images, and styles in a thoughtful and/or important way, such that being altered by the browser might actually make things worse rather than better. The appearance of the content should not be changed except by the user's request. For example, a page might include a list of information with rows whose background colors alternate between white and a light grey. Removing the background color would decrease the legibility of the content.

Usage notes

There are a number of reasons a browser might wish to deviate from the specified appearance, such as:

The content uses text and background colors that will be too similar on the output device for legibility purposes. If the output device is a printer, and to save ink, dark or extremely dense background images might be removed. When printing a page, the browser might want to replace light-colored text on a dark background with dark text on a white background.

Any options the user agent offers the user to allow them to control the use of color and images will take priority over the value of print-color-adjust. In other words, there isn't any guarantee that print-color-adjust will do anything. Not only can the user override the behavior, but each user agent is allowed to decide for itself how to handle print-color-adjust in any given situation.

Formal definition

Value not found in DB!

Formal syntax

No syntax available: No value found in the database.

Examples

Preserving low contrast

In this example, a box is shown which uses a background-image and a translucent linear-gradient() function atop a black background color to have a dark blue gradient behind medium red text. For whatever reason, this is the desired appearance in any rendering environment, including on paper, so we also use print-color-adjust: exact to tell the browser not to make color or style adjustments to the box when rendering it.

CSS
.my-box {   background-color: black;   background-image: linear-gradient(rgba(0, 0, 180, 0.5), rgba(70, 140, 220, 0.5));   color: #900;   width: 15rem;   height: 6rem;   text-align: center;   font: 24px "Helvetica", sans-serif;   display: flex;   align-items: center;   justify-content: center;   print-color-adjust: exact; } 
HTML
<div class="my-box">   <p>Need more contrast!</p> </div> 
Result

Specifications

No specification found

No specification data found for css.properties.print-color-adjust.Check for problems with this page or contribute a missing spec_url to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

No compatibility data found for css.properties.print-color-adjust.Check for problems with this page or contribute missing data to mdn/browser-compat-data.

See also

Applying color to HTML elements using CSS Other color-related properties: color, background-color, border-color, outline-color, text-decoration-color, text-emphasis-color, text-shadow, caret-color, and column-rule-color background-image

Last modified: Feb 1, 2022, by MDN contributors

Select your preferred language English (US)DeutschEspañolFrançais日本語 Change language

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Categories in CSS
css
Search CSS
Search CSS by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
“We ought to take outdoor walks in order that the mind may be strengthened and refreshed by the open air and much breathing.".
Seneca
Random CSS Property

fit-content

The fit-content behaves as fit-content(stretch). In practice this means that the box will use the available space, but never more than max-content.
fit-content() css reference