Show only non-printable area on web page but print only the printable areas


/ Published in: CSS
Save to your folder(s)

Show only non-printable area on web page but print only the printable areas


Copy this code and paste it in your HTML
  1. <html>
  2. <head>
  3. <style type="text/css">
  4. #printable { display: none; }
  5. @media print
  6. {
  7. #non-printable { display: none; }
  8. #printable { display: block; }
  9. }
  10. </style>
  11. </head>
  12. <body>
  13. <div id="non-printable">
  14. non printable area
  15. </div>
  16. <div id="printable">
  17. printable area
  18. </div>
  19. </body>
  20. </html>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.