简体   繁体   中英

HTML5 errors on IE8

I have a problem with internet explorer 8. I´m using modernizr with html5shiv and it´s working apparently well but html5 code is behaving bad. All content that i have into footer goes out.

If I inspect the code...

  • Other browsers OK: <footer id="site_footer"><div id="wrap_footer"></div></footer>
  • IE8 ERROR: <footer id="site_footer"></footer><div id="wrap_footer"></div>

What´s happening? i´m going mad!

pd: It´s not a javascript conflict

Thanks!!

You need use HTML5Shiv technique.

<head>
    <!--[if lt IE 9]>
         <script src="html5shiv.js"></script>
    <![endif]-->
    <!-- all css code after-->
</head>

IE 8 and early don't understand right the HTML5 tags. HTML5Shiv will just once call document.createElement with HTML5 tag name and add to its default css via display: block .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM