View Full Version : using '@media print' prevent areas of page printing, how to do the reverse?

07-15-2011, 04:12 PM
<style type="text/css">
@media all {
.page-break { display: none; }

@media print
.page-break { display: block; page-break-before: always; }

@media print {
div.screenOnly { display: none; }
@media print {
div.noborder { border-width: 0px; border-style: none; }


<div class="screenOnly">
this shows on the screen

<div>this is printed</div>

what I am wanting to do is have a reverse of this so that all the areas i contain within a given <div class="printerOnly"></div> is not shown on the screen but is ready to be printed, when the print button is pressed of course. and all the other areas are not printed.

is this possible ?

07-15-2011, 10:47 PM
@media screen.