CSS Transform Element -
using css transform
property, how can make button this:
i've tried playing skew
, rotate
, rotate3d
, perspective
without luck. feels if need mathematician understand of these new properties
you'll have fiddle rotating along 3 axes, , skewing. here's example:
div { perspective: 200px; width: 150px; position: relative; color: white; line-height: 2.4; text-align: center; padding-left: 20px; } div::before { content: ''; z-index: -1; position: absolute; background: #7fc552; top: 0; right: 0; bottom: 0; left: 0; transform: skew(-9deg) rotatex(-22deg) rotatey(-21deg) rotatez(-9deg); /* firefox seems render pretty bad jagged edges. add transparent outline fix that. */ outline: 1px solid transparent; }
here's live demo: http://codepen.io/josephsilber/pen/jvohk/
Comments
Post a Comment