我有以下CSS:
@media print {
div.question-list-footer
{
position: fixed;
bottom: 0;
padding-left: 180px;
}
div.question-list-footer-center
{
text-align: center;
}
@page { counter-reset: page 1}
}
#pageNumber:after { content: counter(page); }
#pageNumber { counter-increment: page; }
Run Code Online (Sandbox Code Playgroud)
以及我页面上的以下html:
<div class="question-list-footer">
<div class="question-list-footer-center">
<span>Page Number: <span id="pageNumber"></span></span><br/>
Date: @firstItem.Date.Value.ToShortDateString()
Id: @firstItem.Id
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
这在打印时有效,除了所有页面都有"页码1".(IE9,Chrome和FF)我一直盯着这个并且玩了很久但仍然看不出原因.有人有修复吗? - 请告诉我这不明显.(FWIW - Chrome不喜欢我的底部).