Create CSS rectangle with one corner chopped off - HTML CSS CSS

HTML CSS examples for CSS:Function

Description

Create CSS rectangle with one corner chopped off

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">
.corner {<!--from  w  w w .j a va 2 s  . c o  m-->
   width:calc(301px - 21px);
   height:0px;
   border-top:21px solid Chartreuse;
   border-right:21px solid yellow;
}

.main {
   width:301px;
   height:100px;
   background-color:blue;
   color:pink;
   text-align:center;
}
</style> 
 </head> 
 <body> 
  <div class="main"> 
   <div>
     Don't take no for an answer 
   </div> 
  </div> 
  <div class="corner"></div>  
 </body>
</html>

Related Tutorials