Zac*_*ber 6 html css itext flying-saucer
我有html&css用于构建我的iText飞碟页面设置如下...
<html>
<head>
<style type="text/css">
body { padding: 5px; }
.footer {
position: running(footer);
font-size: 11px;
text-align: center;
}
@page {
@bottom-center {
content: element(footer)
}
}
.pagenumber:before {
content: counter(page)
}
.pagecount:before {
content: counter(pages)
}
</style>
</head>
<body>
<div class="content">
lots of content that spans multiple pages in here...
</div>
<div class="footer">
Page <span class="pagenumber"></span> of <span class="pagecount"></span>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
为什么页脚只显示在最后一页?
Zac*_*ber 18
当"内容"足够小以适合1页时,页脚将在该页面上显示正常.一旦"内容"跨越多个页面,页脚将仅显示在最后一页上.
事实证明我需要在内容之前放置页脚,以便在每个页面上显示...
<div class="footer">
Page <span class="pagenumber"></span> of <span class="pagecount"></span>
</div>
<div class="content">
lots of content that spans multiple pages in here...
</div>
Run Code Online (Sandbox Code Playgroud)
如果涉及标题,它看起来是相同的交易......它们应该在页面内容之前.
一些与此相关的链接(最后一个是正确格式的html/css的例子):
| 归档时间: |
|
| 查看次数: |
2570 次 |
| 最近记录: |