gpt4 book ai didi

javascript - 如果我已经在使用 Modernizr,我还需要 HTML5 Shiv 吗?

转载 作者:IT王子 更新时间:2023-10-29 03:03:37 28 4
gpt4 key购买 nike

1) 如果我已经在使用 Modernizr,我还需要 HTML5 Shiv 来为 IE 启用 HTML5 标签支持吗?

2) HTML5 Shiv 仅适用于 IE,还是适用于所有不支持 native HTML 5 的浏览器?喜欢旧版本的 Firefox、Safari、Chrome 等?

最佳答案

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

您不需要单独包含 html5shiv ,因为 Modernizr 包含它:

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.

它仅适用于 Internet Explorer。

其他浏览器的旧版本不需要它:http://caniuse.com/html5semantic

推荐的包含它的代码段是:

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

它只会在低于 9 的 IE 上运行。

关于javascript - 如果我已经在使用 Modernizr,我还需要 HTML5 Shiv 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6883010/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com