Select specific td's with no id or classes - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:id

Description

Select specific td's with no id or classes

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">
tr:first-child td:first-child b {
   color:Chartreuse;
}

tr:first-child+tr td:first-child+td b {
   color:yellow;
}
</style> <!--   w  w  w  . ja  va  2s .  c  o m-->
 </head> 
 <body> 
  <table> 
   <tbody> 
    <tr> 
     <td> <b>L</b> <b>L</b> </td> 
     <td> <b>L</b> <b>L</b> </td> 
     <td> <b>L</b> <b>L</b> </td> 
    </tr> 
    <tr> 
     <td> <b>L</b> <b>L</b> </td> 
     <td> <b>L</b> <b>L</b> </td> 
     <td> <b>L</b> <b>L</b> </td> 
    </tr> 
    <tr> 
     <td> <b>L</b> <b>L</b> </td> 
     <td> <b>L</b> <b>L</b> </td> 
     <td> <b>L</b> <b>L</b> </td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials