I feel i should expand my post above.
So an HTML page viewed on a browser serves a different purpose. Users can read what is on the screen/browser page, and they can also navigate around.
In addition, a typical webpage will have a header, menu and footer section. These areas are just a waste of space (and ink) when printed on paper. I mean, users can’t click on the menu links printed on the piece of paper anyway. Also, the header and footer section may occupy a lot of real estate on a printed page, wasting paper and ink.
This is where @media print CSS stylesheet comes in handy. Because you can create separate rules that will apply only on the printed page (without affecting your browser/screen page style).
So on a printed page, there is no need to show a header, menu, or footer. So you can do
header, menu, footer {
display: none;
}
or maybe you just want simple one-liner header and copyright footer for the printed page
printheader, printfooter {
display: block;
}
or you want to restrict the size of images printed on paper, so they don’t blow up and occupy most of the page.
img {
max-width: ???px;
}
Maybe, there are some sections on the webpage you totally don’t want in the printed version.
.advertisements{
display: none;
}
If you’re using Bootstrap, it’s even easier because they have specific classes for print versions.
.visible-print-block
.visible-print-inline
.visible-print-inline-block
.hidden-print
In the olden days, we have to create a separate “printer-friendly” version of a webpage… for example, to print an article, or a story. This “printer-friendly” version is stripped off all the extras we don’t want printed. But nowadays, that isn’t needed anymore thanks to @media print CSS styling. We can easily turn off sections we don’t want printed, or adjust font/colors to better suit the printed page.