Print
only?

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

    You can use this: http://vikku.info/codesnippets/javascript/print-div-content-print-only-the-content-of-an-html-element-and-not-the-whole-document/

    Or use visibility:visible and visibility:hidden css property together with @media print{}

    'display:none' will hide all nested 'display:block'. That is not solution.

提交回复
热议问题