HTML5shiv vs Dean Edwards IE7-js vs Modernizr - which to choose?

匿名 (未验证) 提交于 2019-12-03 07:50:05

问题:

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.

回答1:

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.



回答2:

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



回答3:

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.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!