【发布时间】:2019-11-02 20:31:21
【问题描述】:
当您尝试在第二页上应用上边距时,页眉的行为不正确。
CSS
body {
font-family: Arial, Helvetica Neue, Helvetica,sans-serif;
font-size: 14px;
}
@page {
margin: 100px 25px;
}
header {
position: fixed;
top: -70px;
left: 0px;
right: 0px;
height: 50px;
}
main {
margin-top: 60px;
}
footer {
position: fixed;
bottom: -100px;
left: -60px;
right: -60px;
background-color: #3f8d99;
height: 60px;
border-top: 1px solid #333;
font-size: 12px;
width: 100%;
padding-top: 6px;
padding-left: 60px;
padding-right: 60px;
color: white;
}
footer .pagenum:before {
content: counter(page);
}
footer .pagenum-container {
margin-top: 16px;
float: right;
}
我试图遵循一些想法,尤其是来自这个Post,但我没有成功。
感谢您的帮助。
【问题讨论】:
-
转到第二页并在 chrome 中
inpect并查看main { margin-top: 60px; }这是否可见? -
这样做没有多大意义,因为我处于浏览器正在生成 PDF 的环境中。
标签: html css laravel laravel-blade dompdf