Click to See Complete Forum and Search --> : text only appearing when printing


pendle666
01-31-2003, 04:51 AM
Hi,

I've got layout.css for the screen layout and print.css for the print layout.

What I would like to do, is have some text in my html file which is only viewable when printed. (contact details).

The layout.css looks like this:

#printfooter {display: none;}
.printtext {display: none;}

and the print.css looks like this:
#printfooter {margin: 1.3em 0.9em 1.5em 1em; }
.printtext {font : 10pt verdana, arial, helvetica, sans-serif; text-align: right; color : black; }


I reckoned that if its possible to use print.css to not print parts of a page, then it would work the other way round.

Can I have text which only appears on printing or am I asking for too much!?

Pendle

Stefan
01-31-2003, 04:57 AM
Originally posted by pendle666
I reckoned that if its possible to use print.css to not print parts of a page, then it would work the other way round.

Can I have text which only appears on printing or am I asking for too much!?



Yes, and the obvious solution is to specify display:none in screen.css for the stuff you don't want on screen.

pendle666
01-31-2003, 05:37 AM
So my theory is right, however I cannot get it to work.
Has anyone else been successful in doing this? If so, some tips and hints as to where I'm going wrong would be nice!

Stefan
01-31-2003, 07:40 AM
I have been successfull with this. You are probably doing somthing wrong, but for me to guess what that is would take quite long. I suggest you post a link to you page instead.

pendle666
01-31-2003, 08:14 AM
Here is a link to the test files:

http://www.raworths.co.uk/test/test.html


The file views as it should for on-screen - that is with the name, contact and disclaimer links on the right and a couple of images on the left.

However when using print preview and/or printing the file, the images and links have gone but the replacement text isn't there.

Thank you for your help.

Pendle

Paul O'B
01-31-2003, 08:35 AM
Hi,

Try changing media="all" to media="screen" and it should work.

Paul

pendle666
01-31-2003, 10:16 AM
that's worked fine, thank you