如何在 html 打印的每一页中保持超过 300px 的页眉高度...?

  • 本文关键字:300px 高度 html 打印 一页 html css
  • 更新时间 :
  • 英文 :

<style>
@page { 
@top-center{
content: "Header text goes here"; 
}
}
div#printhead {
position: fixed; top: 0; left: 0; width: 100%; height: 20em;
padding-bottom: 1em;
border-bottom: 1px solid;
margin-bottom: 10px;
}
@media screen {
div#printhead {
}
div#docbody {
margin-top: 0;
}
}
@media print {
div#printhead {
display: block;
}
div#docbody {
margin-top: 3em;
}
}
</style>

我想在我的打印页面中设置一个更大的标题,内容是动态来自数据库的。 我不能将标题高度增加到 250px 以上。 如何将标题高度增加到 300 像素以上?

有一个属性可能会帮助你。

最小高度:300 像素

最新更新