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

前端 未结 10 1059
-上瘾入骨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:19

    CSS FILE

    @media print
    {
        #pager,
        form,
        .no-print
        {
            display: none !important;
            height: 0;
        }
    
    
        .no-print, .no-print *{
            display: none !important;
            height: 0;
        }
    }
    

    HTML HEADER

    
    

    ELEMENT

提交回复
热议问题