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

前端 未结 10 1060
-上瘾入骨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 04:22

    The best practice is to use a style sheet specifically for printing, and and set its media attribute to print.

    In it, show/hide the elements that you want to be printed on paper.

    
    

提交回复
热议问题