Hide buttons when printing

前端 未结 3 855
醉梦人生
醉梦人生 2021-02-02 13:14

I have a page which contains at the bottom 3 buttons with the following coding:

3条回答
  •  天涯浪人
    2021-02-02 13:51

    You can use CSS @media queries. For instance:

    @media print {
      #printPageButton {
        display: none;
      }
    }

    The styles defined within the @media print block will only be applied when printing the page. You can test it by clicking the print button in the snippet; you'll get a blank page.

提交回复
热议问题