Click here to Skip to main content
11,646,594 members (74,030 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: 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 0:52am

1 solution

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

Solution 1

Yes you can use different media types in your css. Have a look here:[^]

Good luck!
Member 8911636 at 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 at 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 at 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 at 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 at 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 at 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
0 510
1 Sergey Alexandrovich Kryukov 478
2 OriginalGriff 428
3 CPallini 334
4 F-ES Sitecore 309
0 OriginalGriff 1,253
1 994
2 DamithSL 896
3 Sergey Alexandrovich Kryukov 833
4 CPallini 720

Advertise | Privacy | Mobile
Web04 | 2.8.150731.1 | Last Updated 13 Nov 2012
Copyright © CodeProject, 1999-2015
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