Print problem with fixed bootstrap navigation

I made a website with a fixed navigation bootstrap. It fixed navbar, so there is a 70px top fill in the style test.

When I print a page, it adds extra space to the top of the sheet. What can I do to remove the extra space caused by this top fill.

Below is a print preview with the addition

Print Preview of with padding

Below is the non-popup preview I want with less space up.

enter image description here

If I delete the registration, the print will be what I want, but in the browser the content will fall beyond the navigation bar, and I do not see the first 2-3 lines.

Please give me some solution to keep the navbar fixed, and also the add-on is not included in the print.

+4
3

( ):

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

print.css CSS body :

body {
    margin-top: 0;
}
+7

, . , CSS (Bootstrap 3):

@media print { 
    .navbar {
        display: block;
        border-width:0 !important;
    }
    .navbar-toggle {
        display:none;
    }
}
+6

, , , . Site.css:

@media screen {
body {
    padding-top: 50px;
    padding-bottom: 20px;
}

}

, , . ​​

+4

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


All Articles