Search code examples
htmlinternet-explorerinternet-explorer-8semantic-markup

html5 semantic elements and old browsers


I am about to design a new layout for a webpage and wanted to take advantage of this moment to implement some html5 markup.

The first thing that comes in my mind are the semantic elements (nav, header, article..)

After checking http://caniuse.com/#feat=html5semantic I noticed that IE8 (and below) don't support the elements. This probably means that I cannot style the semantic elements expecting a coherent result.

The website receives quite a lot of traffic from IE7/8 browsers and I don't know how to proceed. I heard about modernizr and html5shiv but I don't know what's the best standard nowadays..


Solution

  • Because you're only looking for a method to style HTML5 elements, use HTML5Shiv (which is specifically designed for this purpose). Modernizr contains many more features. which you're not going to use (judging by the question).

    Here's the source code, in case you're wondering: https://github.com/aFarkas/html5shiv/blob/master/src/html5shiv.js