• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
techaj tech news blog

techaj.com

Inspired by Technology

  • Home
  • Blog
  • About Us
  • Contact Us
  • Privacy Policy

How to disable Print Option in Website

लेखक Ajay Kumar

Web Page printing is very easy method to steal information of copyrighted materials.if you are web developer and developed a web application but you don’t want to print webpage by any visitor then how will you do this??How to disable Print Option in Website?

I have solution for this problem.you don’t need write any big script code like php script or any serer side programming codes.

this can be done by simple css code.

CSS code means Cascading Style sheet.

Jut add a print media query in css file.

see example

@media print {
body {
display: none; /* this code will hide whole pages */
}
}

if you will add this CSS code in head section of HTML tag then visitor can not print webpage.

When visitor will try to print then whole webpage will show blank.

Now you can show print loading error message someone will try to print webpage , for show error write this code

@media print {
html,body {
display: none; /* This code will hide whole pages */
}
}

when you add html,body tag then print option will not work and this will show like this :

How to disable Print Option in Website

इसको शेयर जरुर करे और दुसरो को मदद करे

Related posts:

  1. Why you should enable comment option in blog post
  2. How to check website speed
  3. How to edit webpage of any website?
  4. How to download a website

Topic Category : How To Guide

Primary Sidebar





पोस्ट पढने के लिए Search करे
techaj blog

best web hosting for blog

Copyright © 2021.You can contact us for any query at [email protected]