css element selector

Child element selector

h1> strong {Color: Red;}
 // This will rule following the first two strong elements h1 to red, but the second strong h1 is not affected:

<h1>This is <strong>very</strong> <strong>very</strong> important.</h1>
<h1>This is <em>really <strong>very</strong></em> important.</h1>

 Descendant selectors (descendant selector), also known as a selector included

Color {em h1: Red;}
 // above will as a rule progeny em element h1 of the element becomes red text. Other em text (e.g. em references paragraph or block) this rule is not selected:
<h1>This is a <em>important</em> heading</h1>
<p>This is a <em>important</em> paragraph.</p>

 

Guess you like

Origin www.cnblogs.com/-constructor/p/11961161.html