我的代码的一个例子是:
<div class="print">
This div needs to be on one page.
</div>
<div class="print">
This div needs to print on a separate page.
</div>
Run Code Online (Sandbox Code Playgroud)
我有一对divs像上面那样,我需要每个人div在打印时都在自己的页面上.我试着'page-break-before'和'page-break-after'对.print在print.css类.我不确定我做错了什么.
在我看来,这似乎'page-break-after'是正确的,这是我在搜索时总能找到的解决方案,但我似乎无法让它工作.