Does Javascript have the effect of a printed version of a site?

A simple question, I don’t have a printer. My client asks if the hiddent elements of the web page (the elements that appear on the click) will be printed on the paper, or will they be hidden?

+3
source share
5 answers

You can provide a separate css file for printing so that you can determine exactly what is visible and what is not when printing. eg,

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

Without a specific css file, most browsers will simply use the css file for printing. A.

+6
source

: - ( PDF-) .

: CSS (, Firebug, ). CSS @media.

+5

Firefox .

, , , . SO.

+1

, , @media print, ( ) . , , .

0

Similarly, you can do

 @media print { 'your elements ref' {display:none;visibility:hidden}}

or it’s even better to use a background color / white / transparent; o)

0
source

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


All Articles