Responsive triangle div - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

Responsive triangle div

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">
.tr {<!--from   w  w w .jav a 2s.c  om-->
   padding-bottom:31%;
   position:relative;
   overflow:hidden;
}

.tr:before {
   content:'';
   position:absolute;
   top:0;
   left:0;
   width:121%;
   height:100%;
   background-color:Chartreuse;
   -webkit-transform-origin:0 100%;
   -ms-transform-origin:0 100%;
   transform-origin:0 100%;
   -webkit-transform:rotate(-18deg);
   -ms-transform:rotate(-18deg);
   transform:rotate(-18deg);
}

.content {
   position:absolute;
}
</style> 
 </head> 
 <body> 
  <div class="tr"> 
   <div class="content">
     Lorem ipsum dolor sit 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials