Css ">" selectors usage - HTML CSS CSS

HTML CSS examples for CSS:Selector

Description

Css ">" selectors usage

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.chess_board tr.chess_line {
   background-color:Chartreuse;
}

table.chess_board tr.chess_line>td.chess_cell {
   border:3px solid yellow;
}

table.chess_board tr.chess_line>td.chess_cell span {
   position:relative;
   bottom:0.2em;
}

table.chess_board tr.chess_line>td.white_cell {
   background-color:blue;
}

table.chess_board tr.chess_line>td.black_cell {
   background-color:pink;
}

table.chess_board tr.chess_line>td.white_piece {
   color:OrangeRed;
}
</style> <!--from w w w. j  a v  a  2  s  . co  m-->
 </head> 
 <body>
   Lorem ipsum dolo 
  <table class="chess_board"> 
   <tbody> 
    <tr class="chess_line"> 
     <td class="chess_cell black_cell white_piece"> <span>L</span> </td> 
     <td class="chess_cell white_cell white_piece"> <span>L</span> </td> 
     <td class="chess_cell black_cell white_piece"> <span>L</span> </td> 
     <td class="chess_cell white_cell white_piece"> <span>L</span> </td> 
    </tr> 
    <tr class="chess_line"> 
     <td class="chess_cell white_cell"> <span>L</span> </td> 
     <td class="chess_cell black_cell"> <span>L</span> </td> 
     <td class="chess_cell white_cell"> <span>L</span> </td> 
     <td class="chess_cell black_cell"> <span>L</span> </td> 
    </tr> 
   </tbody> 
  </table>Lorem ipsum dolor sit amet, consectetur ad  
 </body>
</html>

Related Tutorials