为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

page-break-before is not working... suggestions?

more options

page-break-before is not working. It does work on chrome. I need to force a page break. how can I do this?


 
page-break-before is not working. It does work on chrome. I need to force a page break. how can I do this? <div style="page-break-before: always;">&nbsp;</div>

所有回复 (6)

more options

Superseded by break-before : Please see :

Please let us know if this solved your issue or if need further assistance.

more options

OK, In chrome, or if I create a pdf, it works. When I print from Firefox, on any printer, it does not always work. If I have 2 page breaks close, the 2nd one does not work in Firefox.


I appreciate your help.

more options
more options

Attached is the skeleton of the HTML.

When I put just this code in a page, not one page break works. When however, I replace "(2)more content here" which is more content (> 1/2 page), then the first break works.... because it is more content???

If all 3 sections have content > 1/2 page, all the page breaks work. Again this issue exists only in Firefox.

Am I missing something?

由Ed Arthur于修改

more options

W3C.org (World Wide Web Consortium) in charge of standards and practices and future development of web page code and web browsers. Pages rank higher in Google when code is correct. Use your Google Webmaster Account to submit and track.

HTML ERRORS - https://validator.w3.org/nu/?doc=http%3A%2F%2Fww38.yourschool.com%2F

CSS ERRORS - https://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.yourschool.com%2F&profile=css3&usermedium=all&warning=1&vextwarning=&lang=en

Please let us know if this solved your issue or if need further assistance.

more options

Thanks for the screenshot.

I'm pretty sure the problem is on the first line. You're partially triggering Firefox's table layout rules, which do not paginate the same way as its block element layout rules.

Compare: https://www.jeffersonscher.com/res/page-break-before.html

Why do you use display:table for the outer div? Or to put that another way, can you get whatever effect you're looking for in some other way?