Learn HTML step-by-step from A to Z or improve your professional skills.  Home HTML and CSS Tutorials No Print Script

No Print Script


Demo: Try to Print this page or Print Preview

<style type="text/css" media="print">
body
{
   display: none;
}
</style>
No Print Script

Put the above script between the <head> </head> tags in your page. It will make your page empty when it is printed. The code is fairly simple to understand.

<style type="text/css" media="print">

Here we declare that the following script is a CSS Script and media is print which means it is intended for paged, opaque material and for documents viewed on screen in print preview mode.

body
{
   display: none;
}

Sets the body of the page to blank when the page is printed.

Note: This is especially useful when you don't want some of the pages on your website to be printed and only be read online. Of course you cant protect the content of the page with this script alone, because cut and paste still would print work here. That is another issue which is not discussed here.



Author's URL: Ades Tynyshov
Learn HTML step-by-step from A to Z or improve your professional skills. More Tutorials: Featured Materials | Fresh Materials | More HTML Tutorials at Markuptutorials.com

Reader's comments
comments credit loans September 22, 2011 says:
Buildings are not very cheap and not every person can buy it. But, loans was created to help different people in such kind of hard situations.
Reply
comments personal loans September 21, 2011 says:
It's cool that people can receive the mortgage loans and this opens completely new chances.
Reply
comments LOURDESRoberts19 July 03, 2011 says:
When you're in not good state and have no money to move out from that, you will have to receive the <a href=" loans</a>. Just because that should aid you for sure. I get sba loan every year and feel myself great just because of it.
Reply
Add comments to "No Print Script"

Captcha