Select multiple siblings CSS classes without repeating full path - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:element sibling

Description

Select multiple siblings CSS classes without repeating full path

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">
h1, h2, h3 {<!--from  w  ww . j  a v a 2  s .co m-->
   color:Chartreuse;
}

table h1,
table h2,
table h3 {
   color:yellow;
}
</style> 
 </head> 
 <body> 
  <h1>Lorem</h1> 
  <h2>Lorem</h2> 
  <h3>Lorem</h3> 
  <table> 
   <tbody> 
    <tr> 
     <td> <h1>Lor</h1> </td> 
     <td> <h2>Lor</h2> </td> 
     <td> <h3>Lor</h3> </td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials