Javascript 打印时底部有页脚

Javascript 打印时底部有页脚,javascript,jquery,css,html,Javascript,Jquery,Css,Html,我正在尝试在我的html页面上打印内容 格式是 <div class="header">Title of the page</div> <div class="main">Content of the page</div> <div class="footer">Footer of the page</div> <div class="page-break"></div> <div cl

我正在尝试在我的html页面上打印内容

格式是

<div class="header">Title of the page</div>

<div class="main">Content of the page</div>

<div class="footer">Footer of the page</div>

<div class="page-break"></div>

<div class="header">Title of the page</div>

<div class="main">Content of the page</div>

<div class="footer">Footer of the page</div>

<div class="page-break"></div>

<div class="header">Title of the page</div>

<div class="main">Content of the page</div>

<div class="footer">Footer of the page</div>

<div class="page-break"></div>
问题是页脚位于主div之后,我希望它始终位于页面底部


有什么帮助吗?

将此CSS添加到页脚div中,它应该可以解决您的问题

style="clear: both;"

您的解决方案是否与此线程中的类似


所以你只想要一个页脚?不,我想要每页都有一个页脚。但是在每一页的底部,而不是内容的结尾
style="clear: both;"