Print
only?

前端 未结 30 2203
暖寄归人
暖寄归人 2020-11-22 00:25

How do I print the indicated div (without manually disabling all other content on the page)?

I want to avoid a new preview dialog, so creating a new window with this

30条回答
  •  情书的邮戳
    2020-11-22 00:34

    Use a special Stylesheet for printing

    
    

    and then add a class i.e. "noprint" to every tag which's content you don't want to print.

    In the CSS use

    .noprint {
      display: none;
    }
    

提交回复
热议问题