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

演示:
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;
}

相关文章

vue阻止冒泡事件 阻止点击事件的执行 <div @click=&a...
尝试过使用网友说的API接口获取 找到的都是失效了 暂时就使用...
后台我拿的数据是这样的格式: [ {id:1 , parentId: 0, name:...
JAVA下载文件防重复点击,防止多次下载请求,Cookie方式快速简...
Mip是什么意思以及作用有哪些