A
A
Alexander Baumgertner2011-06-24 10:52:37
css
Alexander Baumgertner, 2011-06-24 10:52:37

Set the font color to white when printing a page

Task:
There is a page with a font on a black background. How do I set the font color to white when printing?
So far I have not tried it, the font remains black.

There is a small block with a black background (implemented with a picture, since background printing is disabled by default in the browser). This block has white text.

Opera and Firefox have different understandings of how to print this block:

image

Answer the question

In order to leave comments, you need to log in

4 answer(s)
P
pel, 2011-06-24
@pel

I will support the previous speaker, but I will not let the parser eat the tags :)
You need an @media rule for CSS.
Read, for example, here:
htmlbook.ru/css/media

@
@resurection, 2011-06-24
_

Add another stylesheet to the page like this:
The media="print" attribute specifies that these styles will only be used for printing. Through these styles, you can change the color of the text.

P
pel, 2011-06-24
@pel

Are the print settings interfering? By default, browsers do not print background-color, background-image. Perhaps, if allowed, it will help with text color as well.

S
Sergey Nalomenko, 2011-06-24
@nalomenko

Maybe it's easier to make a separate printable version of the document?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question