I want to know which are the differences between the css transforms functions rotate
and rotateZ
:
If I applied those properties (with same values) to two different elements I get the same results:
HTML
<div class="rotateZ">
<img src="http://ohdoylerules.com/content/images/css3.svg"/>
<h3>RotateZ</h3>
</div>
<div class="rotate">
<img src="http://ohdoylerules.com/content/images/css3.svg"/>
<h3>Rotate</h3>
</div>
CSS
.rotateZ {
transform: rotateZ(180deg);
}
.rotate {
transform: rotate(180deg);
}
The rotateZ() CSS function defines a transformation that rotates an element around the z-axis without deforming it. Its result is a <transform-function> data type.
transformation: translate(0,10%) rotate(25deg); The rotate operation is done first, then the translate . Show activity on this post. There is no need for that, as you can use css 'writing-mode' with values 'vertical-lr' or 'vertical-rl' as desired.
They do the exact same thing. rotateZ
means 'rotate about the Z axis', and the Z axis points outwards from your screen, basically giving it a third dimension.
You use the same z-axis when you define a property called the z-index
, which I'm sure you know about.
Source: http://www.w3.org/TR/css3-transforms/#funcdef-rotatez
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