jquery - CSS - bevel square and turn -
i need edit css square shown below. please advice how combine transform skew , rotate?
from:
to:
my atempt: jsfiddle
.square { background: #fff; border:2px solid red; height: 200px; width: 200px; margin:100px; transform: skewx(-30deg) rotate(45deg); }
thanks
let's consider need :
- rotate (z-axis) - square rotated @ 45° angle, need handle this. easiest angle notice.
- rotate (x-axis) - it's difficult discern exact angle need rotate backwards, may need play this angle right.
applying transforms
with being said, can use transform
property along appropriate browser implementations of :
.special-rotate { -ms-transform: rotatex(45deg) rotatey(0deg) rotatez(45deg); -webkit-transform: rotatex(45deg) rotatey(0deg) rotatez(45deg); transform: rotatex(45deg) rotatey(0deg) rotatez(45deg); }
this give looks following example, should point can determine values looking :
#square { margin: 0 auto; height: 200px; width: 200px; background: red; -ms-transform: rotatex(45deg) rotatey(0deg) rotatez(45deg); -webkit-transform: rotatex(45deg) rotatey(0deg) rotatez(45deg); transform: rotatex(45deg) rotatey(0deg) rotatez(45deg); }
<div id='square'></div>