Computer >> Computer tutorials >  >> Programming >> CSS

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


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>