Nth-child selecting element - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:nth-child

Description

Nth-child selecting element

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
body {<!-- w  w w  . j a  va  2  s  .  co  m-->
   margin-left:21px;
}

body :nth-child(7) {
   font-family:courier;
   color:Chartreuse;
}

#fancy {
   font-family:Cursive;
}
</style> 
 </head> 
 <body> 
  <div id="left"></div> 
  <div id="right"></div> 
  <div id="top"></div> 
  <div id="bottom"></div> 
  <h3 id="fancy">Lorem ipsum dolor sit amet, </h3> 
  <p>Lorem ipsum dolor sit amet, conse</p> 
  <p id="fancy">Lorem ipsum dolor s</p>  
 </body>
</html>

Related Tutorials