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

前端 未结 10 1149
-上瘾入骨i
-上瘾入骨i 2020-11-22 03:34

I have a link on my webpage to print the webpage. However, the link is also visible in the printout itself.

Is there javascript or HTML code which would hide the lin

10条回答
  •  一整个雨季
    2020-11-22 03:59

    Here is a simple solution put this CSS

    @media print{
       .noprint{
           display:none;
       }
    }
    

    and here is the HTML

    element that need to be hidden when printing

提交回复
热议问题