星号之前的CSS属性的用途 [英] Purpose of asterisk before a CSS property

查看:82
本文介绍了星号之前的CSS属性的用途的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是从Yahoo CSS重置。有人可以解释星号的目的吗?

The following is taken from the Yahoo CSS reset. Can someone please explain the purpose of the asterisks?

body {
  font:13px/1.231 arial,helvetica,clean,sans-serif;
  *font-size:small;
  *font:x-small;
}


推荐答案

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

这篇关于星号之前的CSS属性的用途的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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