HTML5shiv vs Dean Edwards IE7-js vs Modernizr - 选择哪一个?

发布于 2024-09-25 20:27:34 字数 116 浏览 2 评论 0原文

我正在考虑构建我的第一个 HTML5 网站,并且一直在考虑使用 IE。

有 html5shiv、Dean Edwards ie7-js,然后是 Modernizr。这些都大体相同吗?我很困惑该走哪条路。

I'm looking to build my first HTML5 site and have been looking at working with IE.

There is html5shiv, Dean Edwards ie7-js and then Modernizr. Are these all largely the same? I'm confused about which route to go.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

烟柳画桥 2024-10-02 20:27:34

不,它们根本不一样;他们做完全不同的事情。

  • html5shiv 允许您在不理解新 HTML5 标签的 IE 版本中使用它们。如果没有它,IE 将因这些标签而卡住,因此如果您打算使用这些标签,则需要它。不过,不要指望它能让标签在 IE 中真正执行任何操作!它只是阻止浏览器抱怨它们。

  • modernizr 根据可用功能在 HTML 中设置一堆类,您可以使用这些类根据浏览器支持的功能更改布局。 它还允许您在 IE 中使用新的 HTML5 标记,例如 html5shiv。

  • ie7.js(以及 ie8.jsie9.js)使用 Javascript 来改进 IE 的一些缺失功能.

据我所知,它们之间没有交叉(除了 html5shiv/modernizr),因此您可以使用它们的任意组合,具体取决于您需要实现的功能。

当我谈论这个主题时,由于您询问的是使 IE 与其他浏览器更兼容的工具,我建议您也研究一下 CSS3Pie,如果您打算在网站上使用圆角(加上一两个其他功能),这将使您的生活更加快乐。

这也与您提到的其他三个产品没有交叉,尽管它们都旨在使旧版本的 IE 更容易使用。

No, they're not the same at all; they do completely different things.

  • html5shiv allows you to use the new HTML5 tags in versions of IE that don't understand them. Without it, IE will choke on these tags, so you need this if you intend to use the tags. Don't expect it to make the tags actually do anything in IE though! It just stop the browser complaining about them.

  • modernizr sets a bunch of classes in your HTML, depending on the available features, which you can use to change your layout according to what the browser supports. It also allows you to use the new HTML5 tags in IE, like html5shiv.

  • ie7.js (as well as ie8.js and ie9.js) uses Javascript to retro-fit some missing functionality to IE.

As far as I'm aware there's no cross-over between them (aside from html5shiv/modernizr), so you can use any combination of them, depending on what features you need to implement.

While I'm on the subject, and since you're asking about tools to make IE more compatible with other browsers, I suggest you also look into CSS3Pie, which will make your life much happier if you plan to use rounded corners on your site (plus one or two other features).

This also has no cross-over with the other three products you mentioned, though they do all aim to make old versions of IE slightly easier to work with.

别靠近我心 2024-10-02 20:27:34

启动新的 HTML5 项目的最简单方法是使用 initializr。它将指导并让您构建、下载 HTML5 项目文件。

Easiest way to start a new HTML5 project is using initializr. It will guide and let you build, download your HTML5 project files.

辞慾 2024-10-02 20:27:34

它们在某种程度上是相同的,无论哪种方式,走哪条路都是 ATM 的最佳猜测,并且郑重声明,有一个你错过了,
http://html5boilerplate.com/ 这有点像几年前原型和 jQuery 在互联网领域的斗争的重演。相同的空间。我个人认为 jQuery 会获胜,但目前还不清楚其中哪一个会赢得这场特殊的战斗。我不认为我可以推荐 Dean edwards ie7-js,因为它主要是让 IE7 像其他更智能、更讨人喜欢的浏览器一样工作,而不是像其他框架一样充分利用整个 HTML5。

they are somewhat the same, and which way to go is ATM as good a guess either way, and for the record, there's one you missed,
http://html5boilerplate.com/ This is sort of a repeat of some years ago when prototype and jQuery were fighting in the same space. I'd personally hazard that jQuery won but for now there's no telling which one of these will win this particular fight. I don't think I could recommend dean edwards ie7-js as it mostly deals with just getting IE7 to act like other more intelligent and likable browsers as opposed to leveraging the whole HTML5 thing as much as the other frameworks.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文