S
S
Speakea1y12892019-06-21 12:10:15
css
Speakea1y1289, 2019-06-21 12:10:15

How to print a specific area on an HTML page with all styles?

Good afternoon. There is the following site - postroeno.bitrixstudio24.ru/price . This site has a form with id="ajax_form"
1e1d105638.png
How can I implement a print button for this particular area so that all the styles of this form and its content are saved? And there should not be any extra fields and blocks.
Decision:

@media print { /* Стиль для печати */
    body{
        visibility: hidden;
    }

/* Блок который нужно отобразить */
    .box {
       visibility: visible;
     }
 }

, which I found earlier, is not suitable, as white margins appear, because visibility does not completely hide the element, not like display: none, but the problem is that if I set display: none for body and display: block for the desired block to print, that block will still not be displayed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Named, 2019-06-29
@Named

You can hide all elements via

@media print {
* {display:none}
}

Well, for the elements you need, already register display: block

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question