我有一个带有2个可打印页面的html页面。我为每个页面创建了一个媒体打印样式边框,但我的代码仅为第一页添加了边框。所有页面的主体边框 - CSS打印媒体
我需要添加什么才能在每个页面上显示边框?
请在下面找到我的印刷媒体CSS,并看看我的截图;
@page {
size: A4; /* auto is the initial value */
margin: 1.54cm 1cm 1.54cm 1cm;
marks: crop cross;
}
html, body {
-webkit-print-color-adjust: exact;
margin:0;
padding:0;
height:100%;
min-height: 100%;
border: 2px solid #cc0000!IMPORTANT;
}
.contract {
min-height:100%;
position:relative;
height: 100%;
box-decoration-break: clone;
}
h2, h3 {
page-break-after: avoid;
}
截图与BUG:http://scr.hu/0fbv/5u4qh
那!重要的大写看起来比我习惯的重要(!重要)。 – Alvaro
[可能重复]你试过这个吗? http://stackoverflow.com/questions/32232281/draw-a-border-around-each-page-on-print-css –