css - Bang IE7 - 这是什么意思?

标签 css internet-explorer internet-explorer-7 internet-explorer-6

这个标题并不像看起来那么疯狂。我保证!!

在研究另一个问题时,我在 Stack Overflow 的样式表中注意到以下内容:

...
width: auto;
...
width: 650px!ie7;
padding-bottom: 20px!ie7;
...

这是一种奇怪的条件样式吗?这是一个错误吗?假设这不是一个错误,这是否适用于所有 IE 版本?有没有一种方法可以指定给定的规则只应用于大于——比如说——7 的 IE 版本?

我以前从未遇到过这种情况——我一直对特定于 IE 的样式使用条件注释(并且为了它的值(value),我更喜欢将所有特定于 IE 的样式完全分开)。

最佳答案

我以前听说过这个,但不是确切的文本 !ie7

我在这里找到了一个引用:http://www.javascriptkit.com/dhtmltutors/csshacks3.shtml

!ie

Internet Explorer 7 fixed one of the issues with the !important identifier, but it still has problems when the identifier has an error in it. If an illegal identifier name is used in place of important, Internet Explorer 7 and below will handle the property normally instead of failing. Therefore, in any style declaration block, you can include properties intended to only apply to Internet Explorer and add an !ie identifier. Almost any word can be used in place of ie.

The !ie identifier allows the property to be applied in IE 7 and below. It may or may not work in future versions. Warning: this uses invalid CSS!

因此,width: 650px!ie7; 将仅适用于 IE 7 及以下版本。

实际文本 ie7 不是必需的,但它是一个合理的字符串,可以提醒人们黑客背后的目的。

关于css - Bang IE7 - 这是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4987418/

相关文章:

html - 当我有#id #id 时,为什么 CSS 不起作用?

.net - ActiveX,安装不工作

css - 显示表格在 IE7 中不起作用

html - 带有行高的标题中的长标题(多行)

css - 实现不覆盖我现有的类(class)

jquery 函数在 IE 中不起作用

css - 下拉导航在 IE 中不起作用

internet-explorer-7 - 如何在IE8中实现圆 Angular

html - 互联网浏览器 : relatively positioned button alignment in absolutely positioned box

javascript - 使用ejs模板设置背景图片