Add content with :after pseudo element - HTML CSS CSS Selector

HTML CSS examples for CSS Selector:after

Description

Add content with :after pseudo 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">
.dropbox {<!--from  w  ww . j  av  a2 s .c o  m-->
   border:3px solid Chartreuse;
   height:201px;
   width:51%;
   margin:auto;
   position:relative;
}

.dropbox:after {
   content:'';
   position:absolute;
   width:11px;
   height:11px;
   background:yellow;
   top:100%;
   left:51%;
   margin-left:6px;
}
</style> 
 </head> 
 <body> 
  <div class="dropbox"> 
  </div>  
 </body>
</html>

Related Tutorials