作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试制作一个在线表格,其中包含页眉(带有公司 Logo )和页脚(具有三个不同的地址)。 body 里有很多东西。我需要在表单的每一页都显示页眉 Logo ,但我只需要在第一页而不是每一页上修复页脚。
我正在使用的标题 Logo @page { @top {内容:流(page_header); }} 。
但是当我对页脚使用相同的东西时,它不起作用。有人可以帮我解决这个问题吗?
注意:我正在使用 docraptor 将 html 转换为 pdf。
最佳答案
这里是 DocRaptor 的开发人员。您可以使用一些简单的 CSS 来做到这一点。这是一个完整的示例:
<!DOCTYPE html>
<html>
<head>
<style>
h1 { flow: static(page_header); }
h2 { flow: static(first_page_footer); }
@page {
@top { content: flow(page_header); }
}
@page:first {
@bottom { content: flow(first_page_footer); }
}
hr { page-break-after: always; }
</style>
</head>
<body>
<h1>Header Content</h1>
<h2>Footer Content</h2>
<p>Page 1 content.</p>
<hr />
<p>Page 2 content.</p>
</body>
</html>
希望对您有所帮助!如果您遇到任何不同的问题或想打个招呼,请给 DR 支持发送电子邮件。 :)
关于html - 使用 docraptor : How to flow header logo on every page and fix footer on the first page of pdf. 打印 css 媒体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33473555/
我是一名优秀的程序员,十分优秀!