1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8">5 <title>Sub-selectors</title>6 <styletype= "Text/css">7 8 . First>span{Border:1px solid Red;}/*Add a border style (a solid line with a thickness of 1px and a red color)*/9 span{Ten Border:2px solid Blue; One Color:Blue; A } - </style> - </Head> the <Body> - <Pclass= "First">When I was in third grade,<span>I was still a<span>Timid</span>The Little Girl</span>, the class never dared to answer the teacher asked questions, afraid to answer the wrong teacher will criticize me. Have never had the courage to answer the questions asked by the teacher. The events I held at school<span>121212121</span>I didn't have the courage to join.</P> - </Body> - </HTML>
There is no red solid line frame to understand. However, with a tag selector, all span labels are not added to the border style, either before or after the <style>. Of course, if you comment out the child selector. The effect is as follows:
1 <styletype= "Text/css">2 /*. first>span{border:1px solid Red;} Add a border style (a solid line with a thickness of 1px and a red color)*/3 span{4 Border:2px solid Blue;5 Color:Blue;6 }7 </style>
Sub-selector problem-pending