Print
only?

前端 未结 30 1970
暖寄归人
暖寄归人 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:47

    All the answers so far are pretty flawed - they either involve adding class="noprint" to everything or will mess up display within #printable.

    I think the best solution would be to create a wrapper around the non-printable stuff:

    
        
    
    
        
    Your normal page contents
    Printer version

    Of course this is not perfect as it involves moving things around in your HTML a bit...

提交回复
热议问题