How to make IE support HTML5

黄舟
Release: 2016-12-15 13:26:20
Original
1119 people have browsed it

HTML5 is expected to be released in 2022, but I think it is not that far away from us, because html5gallery lists a large number of sites that are using HTML5, including of course my blog. Regarding HTML5, I have to mention IE. While mainstream browser manufacturers such as Apple, Google, Opera and Mozilla are actively participating in the formulation and promotion of new versions of HTML standards, Microsoft is dismissive of the HTML 5 specification. However, Microsoft has only recently stated that it will support HTML 5 in IE. As of today, IE8 and below cannot support HTML5 tags. But I found a way to make IE support HTML5 in sitepoint.

The following is an example displayed in IE 8, before processing:

To make IE (including IE6) support HTML5 elements, we need to add the following JavaScript to the HTML header. This is a simple document.createElement statement, using Conditional annotations create corresponding nodes in the object for IE.

After adding the above code, the effect displayed in IE8 is as follows:

The JavaScript code for creating nodes in the sitepoint example seems too bloated, and the code provided in smashingmagazine seems to be more concise.
Demo: http://blog.gulu77.com/demo/200908/html5_demo3.html

HTML5 behaves as inline elements by default. To layout these elements, we need to use CSS to manually convert them to Block elements, as shown below:


header, footer, nav, section, article {
display:block;

The above is the content of how to make IE support HTML5. For more related articles, please pay attention to the PHP Chinese website (www.php .cn)!


Related labels:
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!