HTML5shiv vs Dean Edwards IE7-js vs Modernizr - 可以选择哪个? [英] HTML5shiv vs Dean Edwards IE7-js vs Modernizr - which to choose?

查看:118
本文介绍了HTML5shiv vs Dean Edwards IE7-js vs Modernizr - 可以选择哪个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找建立我的第一个HTML5网站,并一直在寻找与IE合作。



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

解决方案

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




  • html5shiv 允许您在版本中使用新的HTML5标签IE不明白他们。没有它,IE会扼杀这些标签,所以如果你打算使用这些标签,你需要这个。不要指望它使标签实际上在IE中做任何事情!它只是停止浏览器抱怨他们。

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


  • ie7.js (以及 ie8.js ie9.js )使用Javascript来改造一些缺少的功能给IE。

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



    当我谈论这个问题时,并且由于您在询问有关使IE与其他浏览器更兼容的工具,所以我建议您也查看 CSS3Pie ,如果您计划在网站上使用圆角(加上一个或两个其他功能),这将使您的生活更加快乐。



    这与你提到的其他三种产品没有交叉作用,尽管它们的目标都是t o使旧版本的IE稍微容易一些。


    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.

    解决方案

    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.

    这篇关于HTML5shiv vs Dean Edwards IE7-js vs Modernizr - 可以选择哪个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆