HTML Page - Printable Version

print version

On the Internet there is a huge amount of various information. Here you can find almost everything, starting from the description of a wild flower and ending with the design of combat vehicles. And, of course, some users want to print the page they are interested in directly from the browser. Modern software can satisfy this need. But one problem is hidden here, because the developers made their pages specifically for playback in a browser, and on paper their documents may look completely different. Especially for such cases, a print version was developed in which new values โ€‹โ€‹are assigned for all pages of the site.

Typically, printed versions of documents on the Internet are used for a certain type of information - for example, if your site has a lot of abstracts or any kind of training aids. Most often, documents with forms, stories, recipes, texts and similar information are printed. A print version is rarely found on interactive sites. If you have an assumption that users who visit your portal will want to copy the information onto paper, then you should take care of the special design.

printable html

In html, the printable version differs from simple pages in a simplified design. Now any modern browser can reproduce almost any idea presented by the developer in a programming language. The situation is different with printers. Not every Internet user has a digital and color device at home. Therefore, when printing, some fragments of the web page are displayed with changes. Page sizes are even more problematic, especially when absolute values โ€‹โ€‹are used. The print version includes a restriction on the use of unnecessary and unnecessary graphic effects. After all, the user, first of all, needs to get the information part of the page, and let the decorative model of the site remain in electronic form.

In order for the browser to understand which version of the site to use for printing, you need to use the keyword "@media". Attention, this is not an HTML value, but a CSS property where the design of your documents will be located, which are already ready for printing on paper. You need to write the keyword โ€œ@media printโ€ (where the latter determines the type of media) using any method convenient for you. After that comes regular CSS code. For example: โ€œ@media print p {color: black; font-family: Times; } ". So the browser will understand that when printing, only black ink and the Times font, which has special serifs, will be used. You can specify any values. The print version of html files may have additional attributes. It is possible to control the page size, its orientation on paper, make additional marks, etc. It does not make sense to list them all, since they are described in detail in specialized directories.

html printable version

The print version is widely used on many sites. At the same time, there is no need to redo your entire portal so that your documents look equally good both on paper and in browsers. CSS developers have very competently designed this situation in accordance with the needs of users.

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


All Articles