I set the size of a parent div to A4 (size="21cm 29.7cm"
). However, in Chrome print preview, with A4 and no margins, the HTML page won't fit on A4. I have to scale it to 80%.
Is there something in my HTML causing this? I expected the size="21cm 29.7cm"
to force the page to be A4.
UPDATE I found this:
And tried the below CSS, but not working:
@page {
size: A4;
margin: 0;
}
@media print {
html, body {
width: 210mm;
height: 297mm;
}
}
HTML:
<!Doctype>
<html>
<head>
<style>
.background
{
position: relative;
top: 0;
left: 0;
}
.text
{
position: absolute;
top: 0px;
left: 0px;
width: 1449px;
height: 2050px;
}
</style>
</head>
<body>
<div style="position: relative; left: 0; top: 0;" size="21cm 29.7cm">
<img src='page0022.jpg' class="background"/>
<img src='0022.svg' class="text"/>
</div>
</body>
</html>