Make half-square background, triangular background - HTML CSS CSS Property

HTML CSS examples for CSS Property:background

Description

Make half-square background, triangular background

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">

.container{<!--from  w  w w  .j  av a 2  s .co m-->
   position: relative;
   overflow: hidden;
   width: 100px;
}
.square{
   width: 100px;
   height: 100px;
   background-color: #E30606;
}
.overlay {
   width: 171px;
   height: 72px;
   background-color: #D0CBCB;
   -webkit-transform: rotate(225deg);
   -moz-transform: rotate(225deg);
   -ms-transform: roate(225deg);
}


      </style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="square"> 
    <div class="overlay"></div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials