I am traying to use:
-webkit-transform: translate3d(0,500px,300px);
X and Y properties working just fine, but Z (300px),just won't work. Here is the jfiddle. What am I doing wrong? I tried both Chrome 24 and Canary 25 Thanks for your support...
CSS | translateZ() function. The translateZ() function is an inbuilt function which is used to reposition the element along the z-axis in 3D space. Parameters: This function accepts single parameter t which holds the length of translation corresponding to z-axis.
CSS | translate3d() FunctionThis parameter holds the value in form of number or percentage. ty: This parameter holds the length of translation corresponding to y-axis. This parameter holds the value in form of number or percentage. tz: This parameter holds the length of translation corresponding to z-axis.
The transform property may be specified as either the keyword value none or as one or more <transform-function> values.
The translate() CSS function repositions an element in the horizontal and/or vertical directions. Its result is a <transform-function> data type.
According to WebKit Blog ,
translate3d(x, y, z), translateZ(z) Move the element in x, y and z, and just move the element in z. Positive z is towards the viewer. Unlike x and y, the z value cannot be a percentage.
You'd need anther element to get the effect. I added a few to your code.
HTML
<div class="coin1">
<div class="coin2"></div>
</div>
CSS
.coin1{
position:absolute;
top:50px;
left:50px;
width:80px;
height:40px;
background:#fc0;
-webkit-transform: rotate3d(1,0,0,-55deg) rotate3d(0,0,1,30deg);
-webkit-transform-style: preserve-3d;
}
.coin1 .coin2
{
background:#444;
width:inherit;
height:inherit;
-webkit-transform: translate3d(0,0,150px);
}
It seems working and JSFiddle is here.
Frankly, I don't have much knowledge about the translate3d and but recently found some links about CSS3 Transformation while learning CSS3.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With