CSS中的“body> *”是什么意思?

时间:2022-11-12 12:47:58

I am trying to understand the CSS effects that jQTouch implements. http://www.jqtouch.com/

我试图理解jQTouch实现的CSS效果。 http://www.jqtouch.com/

It has some CSS definitions that contain syntax like body > *

它有一些CSS定义,包含像body> *这样的语法

body > * {
    -webkit-backface-visibility: hidden;
    -webkit-box-sizing: border-box;
    display: none;
    position: absolute;
    left: 0;
    width: 100%;
    -webkit-transform: translate3d(0,0,0) rotate(0) scale(1);
    min-height: 420px !important;
}
body.fullscreen > * {
    min-height: 460px !important;
}
body.fullscreen.black-translucent > * {
    min-height: 480px !important;
}
body.landscape > * {
    min-height: 320px;
}
body > .current {
    display: block !important;
}

I have searched around for some time, but can't find any hint. Could someone explain it to me?

我已经搜索了一段时间,但找不到任何提示。有人可以向我解释一下吗?

Does it imply animation?

这意味着动画吗?

6 个解决方案

#1


16  

body > * means "any direct child of the body tag", e.g. consider the following scenario

body> *表示“身体标签的任何直接孩子”,例如考虑以下场景

<body>
    <h1>This will be affected by body > *</h1>
    <div>
        This also
        <p>This will not be affected, because it is not a direct child</p>
    </div>
</body>

#2


9  

The > means that only the following * (anything), which is the IMMEDIATE child of the body will be affected.

>表示只有以下*(任何),即身体的IMMEDIATE子项将受到影响。

So body > * basically means every immediate child of the body tag. body * means all tags inside the body tag, no matter the level.

所以body> *基本上意味着身体标签的每个直接孩子。 body *表示body标签内的所有标签,无论级别如何。

#3


4  

The > character is a match indicator and the * is the match being indicated.

>字符是匹配指示符,*是指示的匹配。

So

所以

body > * 

means to match any child of Body.

意味着匹配任何身体的孩子。

http://www.w3.org/TR/CSS2/selector.html

http://www.w3.org/TR/CSS2/selector.html

#4


1  

* is a wildcard selector and simply matches all elements, so body > * will match all direct children of the body element.

*是一个通配符选择器,只是匹配所有元素,因此body> *将匹配body元素的所有直接子元素。

#5


0  

body > * means "any element that is a direct child of the body element."

body> *表示“任何元素是body元素的直接子元素。”

Compare this to body *, which means "any element that is a descendant of the body element." So this would also match the <a> element in <body><p><a>...</a></p></body>, for example.

将此与body *进行比较,这意味着“任何元素都是body元素的后代”。因此,这也会匹配

... 中的元素。

#6


0  

* refers to all elements, and > means immediate child elements, so body > * means all immediate child elements of the body.

*表示所有元素,>表示直接子元素,因此body> *表示正文的所有直接子元素。

It's probably a hack of some kind to refer to a particular browser, though I'm not familiar with it.

虽然我不熟悉它,但它可能是某种特定浏览器的黑客。

#1


16  

body > * means "any direct child of the body tag", e.g. consider the following scenario

body> *表示“身体标签的任何直接孩子”,例如考虑以下场景

<body>
    <h1>This will be affected by body > *</h1>
    <div>
        This also
        <p>This will not be affected, because it is not a direct child</p>
    </div>
</body>

#2


9  

The > means that only the following * (anything), which is the IMMEDIATE child of the body will be affected.

>表示只有以下*(任何),即身体的IMMEDIATE子项将受到影响。

So body > * basically means every immediate child of the body tag. body * means all tags inside the body tag, no matter the level.

所以body> *基本上意味着身体标签的每个直接孩子。 body *表示body标签内的所有标签,无论级别如何。

#3


4  

The > character is a match indicator and the * is the match being indicated.

>字符是匹配指示符,*是指示的匹配。

So

所以

body > * 

means to match any child of Body.

意味着匹配任何身体的孩子。

http://www.w3.org/TR/CSS2/selector.html

http://www.w3.org/TR/CSS2/selector.html

#4


1  

* is a wildcard selector and simply matches all elements, so body > * will match all direct children of the body element.

*是一个通配符选择器,只是匹配所有元素,因此body> *将匹配body元素的所有直接子元素。

#5


0  

body > * means "any element that is a direct child of the body element."

body> *表示“任何元素是body元素的直接子元素。”

Compare this to body *, which means "any element that is a descendant of the body element." So this would also match the <a> element in <body><p><a>...</a></p></body>, for example.

将此与body *进行比较,这意味着“任何元素都是body元素的后代”。因此,这也会匹配

... 中的元素。

#6


0  

* refers to all elements, and > means immediate child elements, so body > * means all immediate child elements of the body.

*表示所有元素,>表示直接子元素,因此body> *表示正文的所有直接子元素。

It's probably a hack of some kind to refer to a particular browser, though I'm not familiar with it.

虽然我不熟悉它,但它可能是某种特定浏览器的黑客。