create a box with slanted edges - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Box

Description

create a box with slanted edges

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style>
.trapezoid {<!--from   ww w .j a v  a  2  s.c  o  m-->
   border-bottom:100px solid Chartreuse;
   border-left:26px solid yellow;
   border-right:26px solid blue;
   transform:rotate(181deg);
   height:0;
   width:126px;
}

.divtext
 {
   transform:rotate(181deg);
   color:pink;
}
</style> 
 </head> 
 <body> 
  <h2>Lorem ipsum d</h2> 
  <div class="trapezoid "> 
   <span class="divtext">Lorem </span> 
  </div>  
 </body>
</html>

Related Tutorials