Click here to Skip to main content
12,699,351 members (34,087 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET C#4.0
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 13-Nov-12 1:52am

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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

Good luck!
  Permalink  
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@Love2Code 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;}
}
E.F. Nijboer 14-Nov-12 13:13pm
   
Why not simply use this to assign the style to all div elements:
@media print { div {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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 13 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100