演示:
print()
@page {
size: A4 landscape;
margin: 0;
}
html, body {
margin: 0;
}
html {
background: cyan;
}
body {
width: 297mm;
height: 210mm;
background: red;
}
A4 横向
的尺寸是正确的,但打印溢出到第二页。这些发生在 Win 10 Chrome 63、FF 52 和 Edge 41 中。
When I use the portrait dimensions and print A4 Portrait, then only one page is printed as expected, without any overflow.
有人知道这个问题吗?它发生在每个平台上吗?
提前致谢
最佳答案
used
body {margin-top: -1px }
print()
@page {
size: A4 landscape;
margin: 0;
}
html, body {
margin: 0;
}
html {
background: cyan;
}
body {
width: 297mm;
height: 210mm;
background: red;
margin-top: -1px;
}
关于html - 具有精确 A4 横向尺寸的空正文元素打印在 2 页上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48320846/