One, sub-selector
The front and back parts of the child selector are separated by a greater-than sign, and the two-part selectors are structurally parent-child.
A child selector is a parent element that is specified according to the left-hand selector, and then looks under the parent element for a child element that matches the right-hand selector.
Second, a simple example
<!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd "><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /><title>Child Selector</title><Linktype= "Text/css"rel= "stylesheet"href= "Css/demo5.css"/></Head><Body><Div> <P>It's a paragraph .<ahref="#">This is a hyper-connect</a> </P></Div></Body></HTML>
@charset "Utf-8";/*CSS Document*//*set the style of the P element under Div*/div>p{font-size:14px;Color:#0000FF; }/*sets the style of the A element under the P element*/P>a{font-size:16px;Color:#FF0000;text-decoration:None;}/*The wrong spelling Div is not a parent-child relationship .*/Div>a{font-size:20px;Color:#FF0000;text-decoration:None;}
Child selectors are rarely used, and generally include choices that are not affected by parent-child relationships
The following wording contains selectors
Div a{ font-size:20px; Color: #FFFF00; Text-decoration:none;}
CSS Sub-selectors (vi)