How can I stop text from being show when I print it?

10-11  Source: Network gathering  Views:0 

Advertisement
You can see the webpage I am working on here: http://www.peterforkes.com/Resume.html
I created a staylesheet called "print.css" and added the following lines to my Resume.html file:
<link href="_css/Resume.css" rel="stylesheet" type="text/css" media="screen" />
<link href="_css/Print.css" rel="stylesheet" type="text/css" media="print" />
In my Resume.html file I have a link that will print a PDF of my resumé.  However, if you print the resumé then I do not want the link to print the resumé to be shown.
In the print.css I created the following class:
.doNotPrint {
color: #FFF;
I applied the class to the 'offending' text, thus:
<p class="doNotPrint"><a href="PDFs/Peter A. Forkes - Resume.pdf">Resume.pdf</a></p>
however, it does not seem to have any effect.  I am assuming (since the background is white) that changing the text color to white should make it invisible.
If you can suggest either how to make my method work (or suggest a better method) that that should mean that I have finished everything I want to do with my webpage.
Thanks,
Peter
I am assuming (since the background is white) that changing the text color to white should make it invisible.
The problem with the CSS is that you've targeted the <p> tag with the rule, not the <a> tag so it has no effect. Normal text in that paragraph will print in white but links will display in #333 because of your rule on a:link and a:visited
Nevertheless, I would avoid those tricks in case you incur the displeasure of the search engines. They're widely used by spammers and are punished accordingly (even though I know we're talking about a print stylesheet and your intentions are honourable :-).
In your print stylesheet, change
.doNotPrint {
color: #FFF;
to
.doNotPrint {
display:none;
Related articles