27
loading...
This website collects cookies to deliver better user experience
.element{
transform: value;
}
Value | Description |
---|---|
translateX(px) | it is used to place element in X axis |
translateY(px) | it is used to place element in Y axis |
translateZ(px) | it is used to place element in Z axis |
translate(x,y) | This is a short form for translateX and translateY |
translate3d(x,y,z) | This is a short form for translateX, translateY and translateZ |
Value | Description |
---|---|
scaleX(px) | it is used to scale element in X axis |
scaleY(px) | it is used to scale element in Y axis |
scaleZ(px) | it is used to scale element in Z axis |
scale(x,y) | This is a short form for scaleX and scaleY |
scale3d(x,y,z) | This is a short form for scaleX, scaleY and scaleZ |
Value | Description |
---|---|
rotate(deg) | It is used to rotate element in 2d dimension |
rotateX(deg) | it is used to rotate element in X axis |
rotateY(deg) | it is used to rotate element in Y axis |
rotate3d(x,y,z, angle) | This is used to rotate element in 3d dimesion |
RotateX and RotateY value will behave like scale if you don't use perspective.
Use prespective property like this. For example, our HTML structure is like
<div class="parent">
<div class="element"></div>
</div>
Then we give CSS like this.
.parent{
perspective: 1000px;
}
.element{
transform: rotateX(10deg);
}
You should give perspective property to the parent.
Value | Description |
---|---|
skewX(deg) | it is used to skew element in X axis |
skewY(deg) | it is used to skew element in Y axis |
skew(deg) | it is a short form for skewX and skewY |