关于CSS控制打印时强制分页

下面是在网上搜到一段解决该问题的代码。


<HTML>
<HEAD>
<!--  -->
<STYLE>
.PagerPrint{page-break-after: always}
</STYLE>
</HEAD>
<BODY>
<!-- 注意:以下的两个Table是并列的 -->

<table id = "tbContent1">
<tr>
<td> 内容一 <td>
</tr>
</table>

<!-- 以下这个div相当于一个分页控制符 -->
<div class = "PagerPrint"></div>

<table id = "tbContent2">
<tr>
<td> 内容二 <td>
</tr>
</table>

</BODY>
</HTML>


但实际测试中发现,很多IE系浏览器会出现不能分页的问题。

这是因为PagerPrint所有的div没有高度的原因,或者是BUG吧!

所以只需要修改一下CSS样式就可以了

.PagerPrint{page-break-after: always;height:1px;}


( ! ) Warning: Missing argument 1 for cwppos_show_review(), called in /data/www/enjoyphp/wp-content/themes/flat/content-single.php on line 29 and defined in /data/www/enjoyphp/wp-content/plugins/wp-product-review/includes/legacy.php on line 18
Call Stack
#TimeMemoryFunctionLocation
10.0000355176{main}( ).../index.php:0
20.0001355464require( '/data/www/enjoyphp/wp-blog-header.php' ).../index.php:17
30.198110159288require_once( '/data/www/enjoyphp/wp-includes/template-loader.php' ).../wp-blog-header.php:19
40.199510230432include( '/data/www/enjoyphp/wp-content/themes/flat/single.php' ).../template-loader.php:74
50.300810786344get_template_part( ).../single.php:5
60.300810786864locate_template( ).../general-template.php:167
70.300910786960load_template( ).../template.php:643
80.300910787344require( '/data/www/enjoyphp/wp-content/themes/flat/content-single.php' ).../template.php:686
90.306110772456cwppos_show_review( ).../content-single.php:29

1 评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注