I need to print a page with a fixed size, and an absolute position div inside:
.page
{
width: 21cm;
min-height: 29.7cm;
padding: 1.2cm;
margin: 1cm auto;
border: 1px #D3D3D3 solid;
border-radius: 5px;
background: white;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
position: relative;
}
Media classes to print:
@page
{
size: A4;
margin: 0;
}
@media print {
.page {
margin: 0;
border: initial;
border-radius: initial;
width: initial;
min-height: initial;
box-shadow: initial;
background: initial;
page-break-after: always;
position: relative;
}
}
The div:
<div id="proc_comp">Printed by Computer</div>
#proc_comp
{
position: absolute;
left: 190px;
bottom: 15px;
font-size: 0.65em;
}
But the div, when I try to Print in the Browser, it does not appear in the same place as the HTML layout, why?
Thanks.