Bang IE7 - 这是什么意思? [英] Bang IE7 - What does it mean?

查看:19
本文介绍了Bang IE7 - 这是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

That title isn't quite as crazy it seems. I promise!!

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

While researching for another question, I noticed the following in Stack Overflow's stylesheets:

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

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

Is this an odd type of conditional styling? Is this a mistake? Assuming it isn't a mistake, does this work with all IE versions? Is there a way of specifying that a given rule should only be applied to versions of IE greater than – say – 7?

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

I have never encountered of this before – I've always used conditional comments for IE-specific styles (and for what it's worth, I prefer keeping all IE-specific styles completely separate).

推荐答案

我以前听说过这个,但没有确切的文本 !ie7.

I have heard of this before, but not with the exact text !ie7.

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

I found a reference here: http://www.javascriptkit.com/dhtmltutors/csshacks3.shtml

!ie

Internet Explorer 7 修复了其中一个!important 标识符的问题,但它仍然有问题时标识符中有错误.如果非法标识符名称用于重要的地方,Internet Explorer7 及以下将处理财产通常而不是失败.因此,在任何样式声明中块,您可以包含属性仅适用于互联网Explorer 并添加一个 !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.

!ie 标识符允许属性适用于IE 7及以下.它将来可能会或可能不会工作版本.警告:这使用无效CSS!

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

So, width: 650px!ie7; will be applied in only IE 7 and below.

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

The actual text ie7 is not required, but it's a sensible string to use, to remind people of the purpose behind the hack.

这篇关于Bang IE7 - 这是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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