Create ribbon style div shape - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Div

Description

Create ribbon style div shape

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <style>
div {<!--from   w  w w . ja  v  a2s  .  c om-->
   width:201px;
   height:100px;
   margin-left:31px;
   background:pink;
   position:relative;
}

div:before {
   content:'';
   position:absolute;
   top:0;
   left:-31px;
   width:0;
   height:0;
   border-left:31px solid Chartreuse;
   border-top:51px solid yellow;
   border-bottom:51px solid blue;
}
</style> 
 </head> 
 <body translate="no"> 
  <div>
    Test 
  </div>  
 </body>
</html>

Related Tutorials