Completely block printing of your HTML file or webpage

This extremely simple piece of CSS style / code:

@media print
{
    body
    {
        display: none;
    }
}

will completely prevent printing of your webpage or HTML file. No matter what browser or “trick” will your user use, as long as give piece of software supports CSS styles — nothing will be printed.

Leave a Reply