Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Suppose I have some text which is displayed over an image or some other printable colours. Is it possible to force this text to white when printing? The default behaviour is to force white to black or grey in most browsers.
Posted

1 solution

Yes you can use different media types in your css. Have a look here:
http://www.w3schools.com/css/css_mediatypes.asp[^]

Good luck!
 
Share this answer
 
Comments
Member 8911636 13-Nov-12 7:40am    
E.F Nijboer thanx for Quick Response
Kindly explain how i implement these mediatypes on printing "Div"
E.F. Nijboer 13-Nov-12 10:55am    
How do you mean? There are plenty examples on w3cschool and you can even try yourself directly on the site itself.
Member 8911636 13-Nov-12 11:19am    
i have tried it.
but not displaying white text in Print out.
it display white in gray...
E.F. Nijboer 13-Nov-12 13:15pm    
You have to be somewhat more specific. Can you update your question and add an example of the html and css? Would make it easier to pinpoint the problem.
Rob Branaghan 14-Nov-12 11:59am    
Basically what ever the div class or id is in the html, have that in a media type of print and have the color:black;

look at the example on that weblink given by E.F. Nijboer...

@media print
{
.my-div-i-want-white-text-to-be-black {font-family:times,serif;font-size:10px;color:black;}
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900