我一直在为客户制作打印页面。玩了一段时间后,我发现我得到了一个额外的空白页。不寻常的是,如果我在 Web Developer for chrome 中选择“大纲块级元素”,额外的页面就会消失。这是该页面上现在使用的所有 CSS:
@page
{
size: auto; /* auto is the initial value */
margin: 0mm; /* this affects the margin in the printer settings */
}
body
{
background-color:#FFFFFF;
height: 296mm;
border: 1px solid black;
margin: 0px; /* this affects the margin on the content before sending to printer */
}
.print_A4 {
margin: 0mm;
padding: 0mm;
height: 270mm; /*A4 Size*/
width: 210mm; /*A4 Size*/
}
.A4_content {
margin-left: auto;
margin-right: auto;
margin-top: 44mm;
height: …Run Code Online (Sandbox Code Playgroud) css ×1