itsols
itsols

Reputation: 5582

printing part of an html page

I'm making a pretty large data entry form in html (LAMP).

I need to print it on a pre-printed sheet. So the labels should not print.

Is there any easy CSS rule that states not to print certain elements? Or should I turn them (the labels) off one at a time programmatically?

Thanks!

PS: It must work on FF and IE at least.

Upvotes: 2

Views: 1076

Answers (1)

Phrogz
Phrogz

Reputation: 303234

Use a print stylesheet that hides (visibility:hidden) all the pre-printed data.

<link rel="stylesheet" type="text/css" href="print.css" media="print">

The rules in this stylesheet will only be applied during printing. You can, however, debug it (see what the results would be like without actually printing the page) by temporarily changing media="print" to media="all".

Read more here.

Upvotes: 3

Related Questions