(Nested spans)
<p class="example"> <span >Quick <span >brown <span >fox <span >jumps <span >over <span >the <span >lazy <span >dog. </span> </span> </span> </span> </span> </span> </span> </span> </p>
p.example > span:first-child {font-size:550%; font-variant:small-caps} span > span {font-size:smaller}
Quick brown fox jumps over the lazy dog.
span {font-variant: normal} p.example > span:first-child {font-size:550%; font-variant:small-caps} span > span {font-size:smaller}
Does that mean that the first rule over-rides the later ones?
Why do we need the CSS rule
span {font-variant: normal}
to cancel the effect of the
p.example > span:first-child {font-variant:small-caps}
on all of the words after the first?
What would happen if we used this CSS rule:
instead of
span:first-child {font-size:550%}
p.example > span:first-child {font-size:550%}
?
See