我的网页仅打印到一页(没有中断)
我在打印信息网页时遇到问题,该信息应该跨越大约 3 页。目前只打印了1页,其余数据在任何地方都看不到?是否有一些 JS 或 HTML 我可以用来中断页面,并允许信息继续打印在下一页上。
I'm having trouble printing a web page of information, which should span onto about 3 pages. Currently, only 1 page is printed, and the rest of the data is not visible anywhere? Is there some JS or HTML I can use to break the page, and allow the information to continue being printed on the next pages.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要一个打印样式表,并且它的高度应设置为“自动”,溢出设置为主体的“可见”。我所做的就是这样:
只需将其放入您的主 CSS 文件或它自己的文件中。
You need a print stylesheet, and it should have height set to "auto" and overflow set to "visible" for the body. What I do is something like:
Just put that in your main CSS file or in a file of its own.
A List Apart 上有一篇非常好的文章,介绍了如何准备要打印的网站。
有一个已知的错误,浮动的 div 被切断,可能值得您看一下。
A List Apart / CSS Design:即将打印(请参阅部分:修复浮动错误)
希望这有帮助!
There's a pretty good article on A List Apart about preparing your site for print.
There is a known bug with floated divs getting cut off, it might be worthwhile for you to take a look.
A List Apart / CSS Design: Going to Print (See the section: Fixing a float flub)
Hope this helps!
你也可以强制休息
You can also force your breaks