CSS3 :empty selector and content property - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:empty

Description

CSS3 :empty selector and content property

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">
ul {<!--   w w w.jav  a 2 s . c  o m-->
   min-height:41px;
}

ul:empty {
   content:'Empty';
}

ul:empty:after {
   content:"AFTER EMPTY";
}
</style> 
 </head> 
 <body> 
  <ul></ul> 
  <ul> 
   <li>Lorem ip</li> 
   <li>Lorem ip</li> 
  </ul>  
 </body>
</html>

Related Tutorials