Css selector inside another element - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:not

Description

Css selector inside another element

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">
.buttonClass {<!--   w w w .  ja v  a 2  s  .c  om-->
   color:Chartreuse;
}

.buttonClass:active {
   color:yellow;
}

.spanClass {
   color:blue;
}

.buttonClass:active .spanClass {
   color:pink;
}
</style> 
 </head> 
 <body> 
  <button class="buttonClass"> <span class="spanClass">Lorem ipsum dolor </span>Lorem ipsum dol</button>  
 </body>
</html>

Related Tutorials