两个CSS选择器之间的区别:为什么要使用“* html”? [重复]

时间:2022-11-20 21:15:30

Possible Duplicate:
CSS: *html #id_name

可能重复:CSS:* html #id_name

I have a simple CSS question. What's the difference between these two selectors

我有一个简单的CSS问题。这两个选择器之间有什么区别

* html div.body_content{
     height:100%;
}

vs

div.body_content{
     height:100%;
}

3 个解决方案

#1


7  

* html is a non-standard way of targeting IE6. As html is the root tag the * selector shouldn't work but does in IE6.

* html是一种针对IE6的非标准方式。由于html是根标记,*选择器不应该工作,但在IE6中。

#2


1  

* html is a hack for IE 6. It is non-standard and because IE 6 treats HTML tag as a child of *, which it takes as a the root element, we can use this to target IE 6.

* html是IE 6的黑客攻击。它是非标准的,因为IE 6将HTML标记视为*的子级,它作为根元素,我们可以使用它来定位IE 6。

#3


1  

Actually By specifying * in the css means all the tags under . But in IE6 the is also one tag under * so this type of representation is write for only to solve the problems in IE6

实际上通过在css中指定*表示下面的所有标签。但是在IE6中,*也是一个标签,所以这种类型的表示只是为了解决IE6中的问题

#1


7  

* html is a non-standard way of targeting IE6. As html is the root tag the * selector shouldn't work but does in IE6.

* html是一种针对IE6的非标准方式。由于html是根标记,*选择器不应该工作,但在IE6中。

#2


1  

* html is a hack for IE 6. It is non-standard and because IE 6 treats HTML tag as a child of *, which it takes as a the root element, we can use this to target IE 6.

* html是IE 6的黑客攻击。它是非标准的,因为IE 6将HTML标记视为*的子级,它作为根元素,我们可以使用它来定位IE 6。

#3


1  

Actually By specifying * in the css means all the tags under . But in IE6 the is also one tag under * so this type of representation is write for only to solve the problems in IE6

实际上通过在css中指定*表示下面的所有标签。但是在IE6中,*也是一个标签,所以这种类型的表示只是为了解决IE6中的问题