Degradation issues for HTML5 semantic tags (article, footer, header)

后端 未结 3 948
终归单人心
终归单人心 2020-12-13 15:16

How well do the new layout tags in HTML5 degrade? What are the hazards in using them? (I\'m not talking about --I\'ve seen specific fallback code f

相关标签:
3条回答
  • 2020-12-13 16:05

    As long as you use html5shiv to handle IE, it will work fine.

    The browser will treat all unknown tags (including HTML5 tags) as normal inline elements.
    You should include the following CSS rule:

    article, aside, figure, footer, header, hgroup,
    menu, nav, section { display: block; }
    
    0 讨论(0)
  • 2020-12-13 16:09

    HTML 5 Tags are not supported in IE the tags are still inactive. To activate the semantic HTML5 tags in IE use the following script inside your head section.

    <!--[if IE]>
    <script type="text/javascript">
    (function(){
    var html5elmeents = "address|article|aside|audio|canvas|command|datalist|details|dialog|figure|figcaption|footer|header|hgroup|keygen|mark|meter|menu|nav|progress|ruby|section|time|video".split('|');
    for(var i = 0; i < html5elmeents.length; i++){
    document.createElement(html5elmeents[i]);
    }
    }
    )();
    </script>
    <![endif]-->
    
    0 讨论(0)
  • 2020-12-13 16:11

    For presentation you'll use CSS anyhow, so doesn't really matter if browser understands the tag itself.

    0 讨论(0)
提交回复
热议问题