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

黄舟
Release: 2017-07-08 10:41:59
Original
3136 people have browsed it

My project has added a CSS to solve the paginationprinting problem

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


When using it, just add the

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>
Copy after login

2.

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

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

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!

Related labels:
css
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!