Checked element number in :nth-child css rule - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:nth-child

Description

Checked element number in :nth-child css rule

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <style>
section {<!-- ww  w .  j  a v  a 2s  . c om-->
   display:none
}

section:first-child,
section:target {
   display:block;
}
</style> 
 </head> 
 <body translate="no"> 
  <a href="#content1">Lore</a> 
  <a href="#content2">Lore</a> 
  <a href="#content3">Lore</a> 
  <section id="content1">
    Lorem ipsum dolo 
  </section> 
  <section id="content2">
    Lorem ipsum dolo 
  </section> 
  <section id="content3">
    Lorem ipsum dolo 
  </section>  
 </body>
</html>

Related Tutorials