page-break-inside:避免使用Firefox和/或IE

Ren*_*ger 19 html css printing printing-web-page

我知道CSS page-break-inside:avoid指令应该在打印HTML文档时防止div中的分页.通过搜索互联网,我发现只有Opera和IE8支持它.是否有解决方法可以防止Firefox(3.6)或IE版本低于8的页面中断?

Ger*_*ben 0

如何仅匹配元素内的所有元素(第一个元素除外),并且不让它们在之前中断?

#yourelement *+*{
    page-break-before: avoid;
}
Run Code Online (Sandbox Code Playgroud)