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.


Close    To Top
  • Prev Article-Web Design:
  • Next Article-Web Design:
  • Now: Tutorial for Web and Software Design > Web Design > HTMLCSS > Web Design Content
    Photoshop Tutorial
     

    Special Effect

      3D Effect
      Photoshop Articles
    Programming Tutorial
     

    C/C++ Tutorial

      Visual Basic
      C# Tutorial
    Database Tutorial
     

    MySQL Tutorial

      MS SQL Tutorial
      Oracle Tutorial
    Geek Tutorial
     

    Blogging Tutorial

      RSS Tutorial
      Podcasting Tutorial
    Graphic Design Tutorial
      Coreldraw Tutorial
      Illustrator Tutorial
      3D Tutorials
    Webmaster Articles
     

    Domain Service

      Web Hosting
      Site Promotion
    Java Tutorial/ Articles
     

    Java Servlets

      JavaEE Tutorial
     

    JavaBeans Tutorial

    XML Tutorial/ Articles
     

    XML Style

      AJAX Tutorial
      XML Mobile
    Flash Tutorial/ Articles
     

    Flash Video

      Action Script
      Flash Articles
    OS Tutorial/ Articles
      Linux Tutorial
      Symbian Tutorial
      MacOS Tutorial
    Personal Tech
      Hardware Tutorial
      Software Tutorial
      Online Auction