Posted By

skozz on 09/02/11


Tagged

css javascript html5


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

jvdelso


HTML5 para Internet Explorer (6+, 7+, 8+)


 / Published in: HTML
 

URL: http://www.angelrmolina.com

La idea de este script es que mediante un pequeño hack JS y conviertiendo todo los elementos HTML5 en display:block IE sea capaz de ordenarlos correctamente como el resto de navegadores.

  1. El JavaSCript:
  2. ***********************************************************************************
  3. <!--[if IE]>
  4. <script type="text/javascript">
  5. var e = ("abbr,article,aside,audio,canvas,datalist,details,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video").split(',');
  6. for (var i=0; i<e.length; i++) {
  7. document.createElement(e[i]);
  8. }
  9. </script>
  10. <![endif]-->
  11.  
  12. El CSS:
  13. ***********************************************************************************
  14. /* HTML5*/
  15. article, aside, details, figcaption, figure,
  16. footer, header, hgroup, menu, nav, section {
  17. display: block;
  18. }

Report this snippet  

You need to login to post a comment.