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.

Html相关问答推荐

我如何 Select 外部html文件元素作为选项,并显示在一个div与jQuery?

如何找到FontAwese图标的Unicode值?

由于列中的图像,它们不会随FlexBox中的窗口大小进行调整

浏览器是在调整大小还是在全屏上交换视频源?

我怎样才能在我的网站上制作花哨的角落

当我关闭时,导航栏跳到了新的生产线

如何创建嵌套的动态表单元素

使用CSS和Slick Carcass使图像适合屏幕

如何从通过 find-each 方法(在 Rails 应用程序中)生成的列表创建下拉菜单?

这两个CSS中的网格居中对齐内部盒子有什么区别?

模拟另一个输入值设置表单输入的数值

如何垂直对齐列表中的图像和文本?

需要帮助个性化我的 CSS 导航栏:如何在鼠标悬停时突出显示
  • 元素?
  • css 网格创建空行和列

    在身体外部创建 tanget 45° div

    把标题、段落和图片放在一起

    在 SQL 中合并 HTML 表中的单元格

    为什么 `html` 上的 overflow: hidden 将滚动框移动到正文?

    所有幻灯片上的 Quarto RevealJS 标题

    Woocommerce Storefront 产品类别页面和购物车菜单项 colored颜色 更改