If I'm already using Modernizr, will I then even need HTML5 Shiv?

18,332

1) If I'm already using Modernizer then even will I need HTML5 Shiv to enable HTML5 tag supports for IE.

You don't need to separately include html5shiv, because Modernizr includes it:

As of Modernizr 1.5, this script is identical to what is used in the popular html5shim/html5shiv library.

http://www.modernizr.com/docs/#html5inie


2) and is HTML5 Shiv only for IE or for all browser who don't have native HTML 5 support. like older version of Firefox, Safari, Chrome etc.

It's only for Internet Explorer.

Older versions of other browsers don't need it: http://caniuse.com/html5semantic

And the recommended snippet to include it is:

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

Which will only ever run for IE less than 9.

Share:
18,332

Related videos on Youtube

Jitendra Vyas
Author by

Jitendra Vyas

Hi, I am Jitendra a front-end developer from India specializing in web standards, accessibility, and usability based development.

Updated on August 14, 2020

Comments

  • Jitendra Vyas
    Jitendra Vyas almost 4 years

    1) If I'm already using Modernizr, will I then even need HTML5 Shiv to enable HTML5 tag support for IE?

    2) Is HTML5 Shiv only for IE, or for all browser who don't have native HTML 5 support? Like older versions of Firefox, Safari, Chrome, etc?

  • Jitendra Vyas
    Jitendra Vyas almost 13 years
    Great and quick answer as i expected. So only IE was the show stopper.
  • Jitendra Vyas
    Jitendra Vyas almost 13 years
    You mean when I download custom Modernizer I should keep marked the HTML5 Shim/IEPP checkbox on this page modernizr.com/download
  • thirtydot
    thirtydot almost 13 years
    Yes, you must keep that ticked if you want html5shiv to be included.