我知道这个问题已被问到。但我无法弄清楚我做错了什么。打印html时,我希望在页面的右上角打印页码。CSS HTML页码
这是我的代码,出了什么问题?
<html>
<head>
<style media="print">
@page {
counter-increment: page;
counter-reset: page 1;
@top-right {
content: "Page " counter(page) " of " counter(pages);
}
}
</style>
</head>
<body>
<div style="height:800px">hello</div>
<div style="height:800px">hello</div>
<div style="height:800px">hello</div>
<div style="height:800px">hello</div>
<div style="height:800px">hello</div>
<div style="height:800px">hello</div>
<div style="height:800px">hello</div>
</body>
</html>