Article introduction of Wulin.com (www.vevb.com): Print HTML5 elements in IE browser (IE Print Protector).
Print HTML5 elements in IE browserIE version 6 7 8 does not recognize new elements in HTML5. IE will use empty <section> and </section> empty elements for unrecognized elements. This also means that the content of unknown elements will not contain their content, and they cannot be styled and include overflowed content into its own DOM node.
In the following example, we will use article to include a title and paragraph with some text.
1
2
3
4
5
6
7
8
<article>
<h1>
Lorem ipsum
</h1>
<p>
Dolor sit amet, consistetur adipisicing elit.
</p>
</article>
Because the IE browser parses the article into an empty element, the title element and paragraph will overflow.
1
2
3
4
5
6
7
<article />
<h1>
Lorem ipsum
</h1>
<p>
Dolor sit amet, consistetur adipisicing elit.
</p>
How IE Print Protector worksShow these elements in the view. IE Print Protector requires an auxiliary tool, a small piece of JS code to help the IE browser support these HTML5 tags. In order to enable these tag elements to be printed, when printing, IE Print Protector temporarily replaces HTML5 elements and replaces them with supported elements (such as div and sapn). IE Print Protector will also generate a special style sheet based on the existing style sheet, which also means that you can more safely define styles for them through link, style, @import and @media methods. IE Print Protector saves the original HTML5 elements of the page. The performance and events of all these elements have no effect.
How to take effect on IE Print ProtectorIE Print Protector not used
Using IE Print Protector
Download IE Print Protector
IE Print Protector Minited JS (1.29KB) (736 bytes gzipped) Uncompressed JS (2.91KB)Project address: IE Print Protector
Original Chinese: How to make IE support the printing style of new HTML5 elements
Project address: IE Print Protector