CSS style descendant selector greater than sign & gt;) usage
This article introduces the use of CSS style child selector greater than sign >), the content is very detailed, interested friends can refer to, hope to be helpful to you.
Div span is a context selector, which means to select all the span in the div, and note that they are all, whether or not they directly inherit the relationship.
But div > span is different. > (greater than sign) is the descendant selector, which represents the descendant span that selects div.
For example, in the structure
The code is as follows:
Son span
Grandson span
Non-div internal span
Div > span can only choose the span of id= "erzi-keleyi-com" because it is a child of div. The span of id= "sunzi-keleyi-com" is not selected.
The following is the example code:
The code is as follows:
Css greater than sign exampl
Div {border:1px solid green;margin:10px} / * div is a green border * /
Span {display:block;background-color:Silver;padding:10px;margin:10px;} / * span background color is silver * /
Div > span {border:1px solid red;} / * has a greater than sign * /
There is no greater than sign in the front end of web.
Only div's son, span, has a red border.
Span, son of div
Div grandson span
Non-div internal span
On the CSS style child selector greater than sign >) the use of the method is shared here, I hope the above content can be of some help to you, you can learn more knowledge. If you think the article is good, you can share it for more people to see.