Multiple css classes in selector - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:class

Description

Multiple css classes in selector

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">
.light_grey_bg {<!-- ww  w  .ja v a2s . c  o m-->
   background:Chartreuse;
}

.onerow.light_grey_bg {
   border-top:3px solid yellow;
   border-bottom:3px solid blue;
}

.onerow.light_grey_bg + .light_grey_bg {
   border-top:none;
}
</style> 
 </head> 
 <body> 
  <div class="onerow">
    Lor 
  </div> 
  <div class="onerow light_grey_bg">
    Lor 
  </div> 
  <div class="onerow light_grey_bg">
    Lor 
  </div> 
  <div class="onerow light_grey_bg">
    Lor 
  </div> 
  <div class="onerow light_grey_bg">
    Lor 
  </div> 
  <div class="onerow light_grey_bg">
    Lor 
  </div> 
  <div class="onerow light_grey_bg">
    Lor 
  </div> 
  <div class="onerow">
    Lor 
  </div> 
  <div class="onerow">
    Lor 
  </div> 
  <div class="onerow">
    Lor 
  </div> 
  <div class="onerow light_grey_bg">
    Lor 
  </div> 
  <div class="onerow light_grey_bg">
    Lor 
  </div> 
  <div class="onerow">
    Lor 
  </div> 
  <div class="onerow">
    Lor 
  </div> 
  <div class="onerow">
    Lor 
  </div> 
  <div class="onerow">
    Lor 
  </div> 
  <div class="onerow light_grey_bg">
    Lor 
  </div> 
  <div class="onerow light_grey_bg">
    Lor 
  </div> 
  <div class="onerow">
    Lor 
  </div>  
 </body>
</html>

Related Tutorials