gpt4 book ai didi

html - 具有精确 A4 横向尺寸的空正文元素打印在 2 页上

转载 作者:太空狗 更新时间:2023-10-29 14:17:11 26 4
gpt4 key购买 nike

演示:

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 中。

enter image description here

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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com