As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center提供指导。




已关闭8年。




{想法来自I've decided not to cater for IE6 - What tasty CSS treats can I use?,但我想要IE7版本}

好的,首先,这不是关于我是否应该使用IE7的讨论。我确定S.O上有数百个线程。在这里您可以讨论其优缺点,市场份额,javascript shivs及其附带的所有其他内容。



放弃IE7会带来哪些新的自由?

我知道你们中有些人会很想告诉我为什么我应该支持ie7或有关js修复的信息,这意味着我可以使用某些东西,等等-请不要浪费您/我/我们的时间!

最佳答案

Microsoft宣称Internet Explorer 8完全兼容CSS2.1,among other things。但是,已经发现了许多错误,因此实际上并没有完全符合要求,但这当然并不意味着它从版本7开始没有得到改善。

无论如何,以下是IE8中引入的一些众所周知的功能,这些功能是IE7中不存在的(此列表绝不是详尽无遗的):

的JavaScript

  • Selectors API level 1(querySelectorAll())
  • 的基本实现
  • cross-origin resource sharing(跨域Ajax)
  • 的基本实现
  • 本机JSON解析功能
  • DOM改进(可能是CSS属性选择器修复的原因-见下文)

  • HTML5中的JS API
  • Cross-document messaging
  • Web storage
  • History traversal

  • 的CSS

    CSS2.1
  • IE8赶上了CSS1属性中添加的所有CSS2.1增强功能(大部分?),您可以在列表中找到at MSDN
  • 修正了关于collapsing marginsfloatingstacking的盒子模型
  • inherit keyword
  • outline property
  • white-space property用于pre-wrappre-line
  • 在任何元素上完全支持display: inline-block
  • display: table
  • Generated content and automatic numbering::before:after伪元素,以及quotescontentattr()函数和CSS计数器
  • Printing and paged media:@page规则现在适用于页面伪类,打印orphanswidows,并且在某种程度上支持分页符
  • :active and :focus pseudo-classes
  • :lang() pseudo-class
  • IE7中影响 sibling 组合器,CSS2.1的+和CSS3的~的晦涩语法问题已在IE8中得到纠正(* + html hack也不再起作用)
  • IE8
  • 中已解决了仅影响相邻兄弟组合器+的DOM更新的晦涩错误。
  • 已影响IE8中CSS2.1和CSS3属性选择器的HTML属性和DOM属性问题已在IE8中得到纠正。
  • 已纠正了一些与特异性相关的晦涩错误;一个示例是我在IEt6 / 7中在dynamic pseudo-classes中标识的各种this answer

  • CSS3

    CSS3中用于box-sizingcontent-box
  • border-box property(padding-box最初是a Mozilla proposal,因此它不存在于IE中;直到最近才被添加到CSS3 UI规范中,并且从2012年1月最后一次调用开始,它仍有被删除的风险草案)
  • 某些CSS3功能已在IE中出现,并由Microsoft提出,很久之后才被重新定义为各自的规范,包括@font-faceoverflow-x / overflow-ytext-align-lastword-wrap(现在为overflow-wrap)和 ruby 文本

  • 的HTML
  • <abbr> <q>
  • <object> fallbacks


  • Data URIs的有限支持
  • WAI-ARIA辅助功能的符合性

  • 当然,一些来源:
  • IE8's release announcement
  • CSS Compatibility and Internet Explorer
  • CSS Improvements in Internet Explorer 8
  • QuirksMode CSS compatibility tables
  • Feature support comparison between IE7 and IE8 at caniuse.com
  • 10-05 20:53
    查看更多