Can I force text to print as white?
This is not entirely in control of the web page author.
For example, this fiddle will print (at least it did for me on a Dell 1720 Laser Printer) white text on any of the three black backgrounds in
IE9
if the user has checked the box found next to:
Tools -> Print -> Page Setup -> "Print Background Colors and Images"
If that box is unchecked, then it will not print the black at all on the first two, but will on the last (since it is an img
tag), but it prints the text as a grey, even over the img
tag. Thus, it seems that the setting for "Print Background Colors and Images" affects how the browser interprets the text, and will allow a true white (knock-out effect) if checked, but not if unchecked.
Firefox
Checkbox found here (which seems to work):
File -> Page Setup -> "Print Background (colors & images)"
For Chrome? Web Page Author Controlled?
I have not yet verified whether the information from this post will do it or not (it does not work for me on my next fiddle, but it may be because it is in an iframe). For elements that should print in Chrome, try setting:
-webkit-print-color-adjust: exact;
Marked answer is wrong. You can control text color in every browser! You just need to output text in svg. Browsers don't change color in svg. Here's an example:
<svg height="40" width="200">
<text font-size="28px" y="25" x="30" fill="#ffffff" >
Some text
</text>
</svg>