Home  >  Article  >  Web Front-end  >  Solution to the failure of css page-break-before in IE8 non-compatible mode

Solution to the failure of css page-break-before in IE8 non-compatible mode

黄舟
黄舟Original
2017-07-08 10:41:593083browse

My project has added a CSS to solve the paginationprinting problem

<style type="text/css">
@media print
{
xmp {page-break-before:always;}
}
</style>


When using it, just add the 43e1fc467495bab219a3286f74139f6ac4d9033ad21c358430e75a24655d3d0f tag where needed.

But recently, in order to solve another problem, it was stipulated that IE8 cannot be set to the compatibility view. It was found that this method failed in the non-compatibility mode.

I tried it and found that this problem only occurs when using XHTML 1.x. The specific reasons will not be analyzed. There are many solutions

1. Without the style tag, directly use Add style="page-break-before: always" somewhere,

For example:

<table style="page-break-before: always">
<tr>
...
</tr>
</table>

2.

<style>
p.breakPage { PAGE-BREAK-BEFORE: always }
</style>
</head>

<body>
...
<p class=&#39;breakPage&#39;></p>

The above is the detailed content of Solution to the failure of css page-break-before in IE8 non-compatible mode. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn