• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WittySparks Logo White

WittySparks

Ignite Your Thoughts

  • Topics
  • Reviews
  • Newsletter
WittySparks / Technology / Programming / Printing HTML5 in Internet Explorer with IE Print Protector

Printing HTML5 in Internet Explorer with IE Print Protector

Updated: August 30, 2022 by Sravan K • 2 min read

HTML5 is the proposed next standard for HTML 4.01, XHTML 1.0 and DOM Level 2 HTML and is estimated that HTML5 will reach W3C Recommendation by late 2010. Since the new HTML5 has got many new elements and attributes which reflect the usage on modern websites, here IECSS has come up with the solution to print HTML5 pages with a proper format by using their new IE Print Protector.

Printing HTML5 in Internet Explorer with IE Print Protector
Printing HTML5 in Internet Explorer with IE Print Protector

IE Print Protector, a piece of JavaScript that allows us to print HTML5 pages in Internet Explorer by rendering the new HTML5 elements in a proper format on both screens and also in print. Internet Explorer 6, 7, and 8 do not recognize new HTML5 elements.

IE treats unknown element start <section> and end </section> tags as void elements. This means unknown elements no longer wrap their contents or won’t format the page well and making them impossible to style and spilling their contents into the DOM.

How exactly IE Print Protector works?

To display the new HTML5 elements in almost all the IE browsers, IE Print Protector uses a shim, a piece of JavaScript that forces support for HTML5 elements in all the versions of Internet Explorer.

How HTML5 elements are rendered?

This is what the IECSS team explains: To display elements correctly in print, IE Print Protector temporarily replaces HTML5 elements with supported fallback elements (like div and span) when you print.

IE Print Protector also creates a special style sheet or CSS for these elements based on your existing styles; this means you can safely style HTML5 elements by element name in links, styles, @imports, and @media. Immediately after, IE Print Protector restores the original HTML5 element to the page, right where you left it. Any references to those elements and any events on those elements will remain intact.

Check out their example HTML5 page with IE Print Protector.

If you found this interesting – you can give it a try by downloading the IE Print Protector Javascript here. And why not share your thoughts about this cool tool.

Related Topics

  • PHP: Is it the best Programming Language ever?
  • How To Build A Great Search Box On Your Website
  • How to make Python3 version default in Windows OS?
  • Latest Java Technologies & Trends for 2020
  • Facts about React Native you are still unaware of!
  • Top JavaScript trends for 2020

Topic: Programming

Previous Post: « TIME – Vote for Leaders and Achievers from INDIA in 2010
Next Post: Quickly Create Google Chrome Extension to promote your Blog or Site »
Profile picture for Sravan K Article by

Sravan K

Contributor at WittySparks
WittySparks Staff

Sravan is a highly experienced web designer, user experience designer and developer. You can connect with him on Twitter or LinkedIn and initiate a chat.

View all posts by Sravan K

Primary Sidebar

Featured Productivity Software

Notion logo
Notion

Notion Workspace can help you stay organized, get started today, and take your productivity to the next level.

Try Notion for FREE

And take this Notion Masterclass by Ali Abdaal for FREE by using coupon code WITTYSPARKSFREE.

The Best Digital Marketing Tool

Semrush logo
Semrush

Grow your business on your terms and get to the top with 55+ marketing tools in 1. Get a flat 40% discount on Semrush Guru plan or Try 14-day PRO Trial.

Try Semrush for FREE

Footer

Explore Topics

  • Technology
  • Business
  • Marketing
  • SEO
  • View All Topics

Sponsors

Partnered with FreePik to use the licensed images.

turn to dhgate for smartphone

Affiliate link disclosure

If you make a purchase from WittySparks links, we will receive a small commission. See our Affiliate Disclosure.

Follow Us

  • Facebook
  • Twitter
  • Pinterest
  • LinkedIn
  • Instagram
  • YouTube
  • RSS
  • Mastodon

Copyright © 2023 WittySparks - All rights reserved.
Hosted on Rocket.net

  • About Us
  • Contact Us
  • Privacy Policy