且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

星号之前的CSS属性的用途

更新时间:2021-08-10 10:20:50

hack for Internet Explorer 7或更低版​​本。

It is a browser specific CSS hack for versions 7 or below of Internet Explorer.


*属性:value

*property: value

虽然Internet Explorer 7更正了
其行为,当属性名称为
前缀有下划线或
连字符时,其他非字母数字
字符前缀被视为它们
在IE6。因此,如果您在
属性名称之前添加
非字母数字字符(例如
asterisk(*)),该属性将是
在IE中应用,而不是在其他
个浏览器。与连字符和
下划线方法不同,CSS
规范不会为星号作为前缀保留
,因此使用此back的b $ b可能会导致
意外行为作为CSS
规范演变。

Although Internet Explorer 7 corrected its behavior when a property name is prefixed with an underscore or a hyphen, other non-alphanumeric character prefixes are treated as they were in IE6. Therefore, if you add a non-alphanumeric character such as an asterisk (*) immediately before a property name, the property will be applied in IE and not in other browsers. Unlike with the hyphen and underscore method, the CSS specification makes no reservations for the asterisk as a prefix, so use of this hack could result in unexpected behavior as the CSS specifications evolve.

* property:value在IE 7及以下版本中应用属性值。它可能或可能
在未来的版本中不工作。警告:
这使用无效的CSS。

*property: value applies the property value in IE 7 and below. It may or may not work in future versions. Warning: this uses invalid CSS.

发件人: http://www.javascriptkit.com/dhtmltutors/csshacks3.shtml