Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

How can I print a certain block/part of a web page? Print option to look like Print Screen functionality.

like image 968
Ahmed Atia Avatar asked Dec 02 '25 21:12

Ahmed Atia


1 Answers

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.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!