CSS selectors grouping: element.class element element.class element - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:class

Description

CSS selectors grouping: element.class element element.class 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">
table.exm_table tbody tr td {
   background-color:Chartreuse;
}

table.exm_table tbody tr:nth-child(odd) td {
   background-color:yellow;
}

table.exm_table tbody tr.odd td {
   background-color:blue;
}

table.exm_table tbody tr.bob td {
   background-color:pink;
}
</style> <!--from   ww w .  j  a va2  s.com-->
 </head> 
 <body> 
  <table class="exm_table"> 
   <tbody> 
    <tr> 
     <td>Lorem ipsum dolor sit amet, </td> 
    </tr> 
    <tr> 
     <td>Lorem ipsum dolor sit amet, </td> 
    </tr> 
    <tr> 
     <td>Lorem ipsum dolor sit amet, </td> 
    </tr> 
    <tr> 
     <td>Lorem ipsum dolor sit amet, </td> 
    </tr> 
    <tr> 
     <td>Lorem ipsum dolor sit amet, </td> 
    </tr> 
    <tr> 
     <td>Lorem ipsum dolor sit amet, </td> 
    </tr> 
    <tr> 
     <td>Lorem ipsum dolor sit amet, </td> 
    </tr> 
    <tr class="odd"> 
     <td>Lorem ipsum dolor sit amet, </td> 
    </tr> 
    <tr class="bob"> 
     <td>Lorem ipsum dolor sit amet, </td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials