SkewX() math formula for full width for 3 divs next to each other - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL

Description

SkewX() math formula for full width for 3 divs next to each other

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">
body {<!-- www  .  j  a v  a  2s .c  o m-->
   margin-left:301px;
}

.parent {
   height:501px;
   width:501px;
   position:relative;
   background:black;
   overflow:hidden;
}

.test {
   transform:skewX(21deg);
   width:51%;
   height:100%;
   position:absolute;
}

.a {
   background:purple;
   right:76%;
}

.b {
   background:green;
   right:26%;
}

.c {
   background:orange;
   left:76%;
}
</style> 
 </head> 
 <body> 
  <div class="parent"> 
   <div class="test a"> 
   </div> 
   <div class="test b"> 
   </div> 
   <div class="test c"> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials