开发者

How can I print a certain block/part of a web page?

开发者 https://www.devze.com 2022-12-19 09:43 出处:网络
How can I print a certa开发者_如何转开发in block/part of a web page? Print option to look like Print Screen functionality.Use css, with the media = print option.

How can I print a certa开发者_如何转开发in block/part of a web page? Print option to look like Print Screen functionality.


Use css, with the media = print option.

Like:

<link rel="stylesheet" type="text/css" href="print.css" media="print" />

The blocks you don't want printed can set display:none.


See http://www.quackit.com/javascript/javascript_print.cfm

You can use javascript's window.print() to print the page. To restrict the printed content to a specific part of the page, you can create a print stylesheet (see http://www.alistapart.com/articles/goingtoprint/) that hides all but the desired content.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号