【发布时间】:2017-11-15 14:47:43
【问题描述】:
我正在尝试创建一个 html 页面,该页面将用于使用浏览器打印数据。我需要包含一个页脚,它会在打印时显示在底部的每一页中,并且我已经开发了以下代码来实现这一点。
以下代码工作正常,但问题是当我在 div content 中的内容变得足够长以使用户向下滚动页面时,如果我转到 Google Chrome 的打印选项并查看打印内容预览,我可以看到页脚出现在第一页,但没有出现在其余页面中。但同样的代码在 Firefox 中也可以工作,并且页脚显示在所有打印页面中(甚至显示在打印预览中)。
您能帮我在使用谷歌浏览器打印时在每页显示页脚吗?
谢谢:)
<html>
<head>
<style type="text/css">
html {margin:0;padding:0;border:0; overflow-y: scroll;}
body { font-size:75%;color:#222; font-family: Geneva, Arial, Helvetica, sans-serif;}
#container {margin:0 auto; height:100%; }
#content{}
#footer {position: fixed ; left: 0px; bottom: 0px; right: 0px; font-size:10px; }
</style>
</head>
<body>
<div id="container">
<div id="content">
My Contents
</div>
<div id="footer">This is my Footer</div>
</div>
</body>
</html>
【问题讨论】: