CSS Transform Skew

realph picture realph · Mar 14, 2011 · Viewed 58.9k times · Source

Does anyone know how to achieve skew like this:

Using CSS's new transform property?

As you can see I'm trying to skew both corners, anyone know if this is possible?

Answer

Stieve Hansen picture Stieve Hansen · Oct 29, 2012
.red.box {
  background-color: red;
  transform: perspective( 600px ) rotateY( 45deg );
}

Then HTML:

<div class="box red"></div>

from http://desandro.github.com/3dtransforms/docs/perspective.html