Tag Archives: CSS

Hiding parts of html page on printing

If you need to create a web page on which some parts should not be visible when it is printed (or even print-previewed) you can use the following CSS:

@media print
{

.notPrint
{

display:none;

}

}

Then in the html you can specify something like this:

<div class=’notPrint’>This is not visible in printing</div>

This is useful if you have things like buttons and other stuff that is not applicable when printing.