html - nth-child() and blockquote css -


i have html code

<blockquote>     <cite>oioik wrote:</cite>      <blockquote>             <cite>oioik wrote:</cite>              <blockquote>                 <cite>oioik wrote:</cite>                 <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. integer posuere erat ante.</p>             </blockquote>              <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. integer posuere erat ante.</p>     </blockquote>      <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. integer posuere erat ante.</p> </blockquote> 

and have css

blockquote {     font-size: 13px;     background-color: blue;     border: 0;     padding-left: 50px; } blockquote:nth-child(even) {     background-color: red; } 

then in example should have blue/red/blue background colors have blue/red/red

there difference between child , descendant.

so if had:

 <blockquote>1</blockquote>  <blockquote>2</blockquote>  <blockquote>3</blockquote> 

they children of same parent, numbered shown.

the second pair red because they're both second child of respective parents (the first being <cite> element.)

in case, don't believe vanilla css achieve want do. may have inject class name this.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -