Prevent padding of wrapped pseudo element with empty content - HTML CSS CSS Property

HTML CSS examples for CSS Property:padding

Description

Prevent padding of wrapped pseudo element with empty content

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">
.outer {<!--   w  w w. jav  a2 s  .c o  m-->
   background-color:Chartreuse;
   text-align:center;
   height:201px;
}

.outer:before {
   background-color:yellow;
   display:inline-block;
   width:201px;
   height:100%;
   content:" ";
}
</style> 
 </head> 
 <body> 
  <div class="outer"> 
  </div>  
 </body>
</html>

Related Tutorials