Delete header and footer in html to print page

Is there a way to remove the header and footer of an html page, so if the user prints it, there is no header and footer.

The user can delete it using the print settings, but I wonder if there is any css or javascript to programmatically delete it?

Thank you for any response.

+4
source share
3 answers

You can do this:

@media print { .noprint { display: none; } } 

Now you can apply the noprint class to the element that you want to hide when printing. A.

0
source

I do some kind of search engine, and everyone said: "I can’t delete them!" other than using ActiveX plugins and third-party developers.

I wonder why some report controls (Telerik Reporting, DevX, ...) can hide the header and footer without using ActiveX or plugins! Do they print the page in other ways? How?

+4
source

You seem to be referring to the header and footer lines that the browser adds, and not to the contents of the printed page. In this case, the answer is: No, you can only change it in the settings.

+3
source

Source: https://habr.com/ru/post/1310002/


All Articles