translate is a new css attribute of css3; the translate attribute is used to define the 2d translation transformation of the element. This attribute is often used in conjunction with the transform attribute. The transform attribute can apply 2d or 3d transformation to the element. The syntax is " transform:translate(x-axis translation distance, y-axis translation distance)".
The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.
The transform property applies a 2D or 3D transformation to an element. This property allows us to rotate, scale, move or tilt the element.
translate(x,y) Define 2D transformation.
The syntax is as follows:
transform:translate([, ]);
The translate() function can move elements.
Value:
translate(
translateX(
translateY(
translateZ(
The example is as follows:
translate() 方法
translate() 方法从元素当前位置对其进行移动:
该 div 元素从其当前位置向右移动 50 个像素,并向下移动 100 个像素。
Output result:
##(Learning video sharing:css video tutorial,html video tutorial)
The above is the detailed content of Is translate a css3 property?. For more information, please follow other related articles on the PHP Chinese website!