In the case header and footer of the browser know that it is possible in the settings:
But I saw an answer in SO
saying that this css
effect:
@page
{
size: auto; /* auto is the initial value */
margin: 0mm; /* this affects the margin in the printer settings */
}
Source:
https://stackoverflow.com/questions/8228088/remove-header-and-footer-from-window-print
If you are talking about a header or footer created by you:
You can do this using display
: none
;
The CSS property display
specifies the type of render box used by an element.
Display with value none
:
Disables element display (without affecting layout); all child elements also have their display disabled.
@media print{
#noprint{
display:none;
}
}
@page{
size: auto;
margin: 0mm;
}
<div id="noprint">
Elemento que será ocultado na impressão...
</div>
header { display: None ! Important; } footer { display: None ! Important; }
– Paula NS