HTML5 tags are not compatible (IE6 ~ 8)

Source: Internet
Author: User

The Semantic tags and attributes of HTML5 make it easy for developers to easily achieve a clear web page layout. With the help of CSS 3 rendering, it is very easy to quickly build a rich and flexible web page.

<! -- [Lt IE 9]> <script type = "text/javascript"> e = "abbr, article, aside, audio, canvas, datalist, details, dialog, eventsource, figure, footer, header, hgroup, mark, menu, meter, nav, output, progress, section, time, video ". split (',' I = (I -- </script> <! [Endif] -->

Method 2:Use Google's html5shiv package (recommended)

 <!--[ lt IE 9]>  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]-->

 

However, no matter which method is used, the CSS of the new tag must be initialized. because HTML5 is represented by inline elements by default, we need to use CSS to manually convert these elements into block elements for easy layout.

  {:}

However, if ie6/7/8 disables the script, it will become a "whiteboard" webpage without style. How can we solve this problem?

We can refer to facebook's practice to guide users into the noscript-marked"/? _ Fb_noscript = 1"Page, use html4 tags to replace html5 tags, Which is lighter than writing a large number of hack to maintain compatibility.

<! -- [Lte IE 8]> <noscript> <style>. html5-wrappers {display: none! Important ;}</style> <div class = "ie-noscript-warning"> scripts are disabled in your browser, please <a href = ""> check here </a> to enable the script! Or <a href = "/? Noscript = 1 "<! [Endif] -->

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.