What is the role of CSS selector greater than sign >:
This section describes the effect of the greater-than sign in the CSS selector. Because of the previous browser support problems, may eat less use of selectors, but over time, the version of the update, compatibility is not a problem, so its application is also more up, the following code example to do a brief introduction.
This selector can match all of the first-level child elements of the specified element.
code example:
<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "Utf-8"> <Metaname= "Author"content= "http://www.softwhy.com/" /> <title>Ant Tribe</title><style>#box{width:200px;Height:300px;}#box > Div{width:100px;Height:100px;Background-color:Green;margin:5px;Border:1px solid Red;font-size:12px;text-align:Center;}</style></Head><Body><DivID= "box"> <Div></Div> <Div> <Div>Ant Tribe</Div> </Div></Div></Body></HTML>
The above code implements our requirements by using the > selector to set the style of the first level child element under the box element.
So the "Ant tribe" string of the container div does not get the corresponding style setting.
The original address is: http://www.softwhy.com/forum.php?mod=viewthread&tid=18185
For more information, refer to: http://www.softwhy.com/divcss/
What is the role of CSS selector greater than sign >