CSS substring matching attribute selectors: Contains multiple class names - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:class

Description

CSS substring matching attribute selectors: Contains multiple class names

Demo Code

ResultView the demo in separate window


<html>
 <head> 
  <style>
td[class~="foo"][class~="baz"] {
   background-color:Chartreuse;
}
</style> <!--   w  w  w .j  a  v a  2  s. c om-->
 </head> 
 <body> 
  <table> 
   <tbody> 
    <tr> 
     <td class="foo bar baz">Lorem ipsum</td> 
     <td>Lore</td> 
    </tr> 
   </tbody> 
  </table>  
 </body>
</html>

Related Tutorials