Ron*_*újo 1 html css dompdf laravel laravel-blade
当您尝试在第二页上应用上边距时,页眉行为不正确。
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;
}
Run Code Online (Sandbox Code Playgroud)
我尝试遵循一些想法,特别是这篇文章的想法,但我没有成功。
谢谢您的帮助。
我找到了解决问题的方法。我更改了 CSS 文件的一些行。
@page {
margin: 140px 25px 100px 25px;
}
header {
position: fixed;
top: -136px;
left: -60px;
right: -60px;
width: 100%;
}
Run Code Online (Sandbox Code Playgroud)
并删除了主类。
/*main {
margin-top: 30px;
}*/
Run Code Online (Sandbox Code Playgroud)
查看结果。第2页:
| 归档时间: |
|
| 查看次数: |
3128 次 |
| 最近记录: |