How do I hide an element when printing a web page?

CSSWeb DevelopmentFront End Technology

To hide the element, add “display:none” to the element with CSS.

<style>
@media print {
   .noprint {
      visibility: hidden;
   }
}
</style>

In addition, add the element, which you want to hide inside the <div>−

<div id="noprint">
   Add here the element, which you want to hide.
</div>
raja
Published on 03-Feb-2018 15:39:21
Advertisements