How to use transform attribute
The transform attribute is used to apply a 2D or 3D transformation to an element; this attribute allows us to rotate, scale, move or tilt the element.
CSS3 transform attribute
Function: The transform attribute applies 2D to the element or 3D conversion. This property allows us to rotate, scale, move or tilt the element.
Syntax:
1 |
|
Can have attribute value description:
none: The definition is not converted.
matrix(n,n,n,n,n,n): Define 2D transformation, using a matrix of six values.
matrix3d(n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n) Define 3D transformation, using 4x4 with 16 values matrix.
translate(x,y): Define 2D transformation.
translate3d(x,y,z): Define 3D transformation.
translateX(x): Define the transformation, just using the value of the X axis.
translateY(y): Define the transformation, just using the value of the Y axis.
translateZ(z): Define 3D transformation, just using the value of the Z axis.
scale(x,y): Define 2D scaling transformation.
scale3d(x,y,z): Define 3D scaling transformation.
scaleX(x): Define the scaling transformation by setting the value of the X axis.
scaleY(y): Define the scaling transformation by setting the value of the Y axis.
scaleZ(z): Define the 3D scaling transformation by setting the value of the Z axis.
rotate(angle): Define 2D rotation and specify the angle in the parameters.
rotate3d(x,y,z,angle): Define 3D rotation.
rotateX(angle): Defines 3D rotation along the X axis.
rotateY(angle): Defines 3D rotation along the Y axis.
rotateZ(angle): Defines 3D rotation along the Z axis.
skew(x-angle,y-angle): Defines the 2D skew transformation along the X and Y axes.
skewX(angle): Defines the 2D skew transformation along the X-axis.
skewY(angle): Defines the 2D skew transformation along the Y axis.
perspective(n): Defines the perspective view for the 3D transformation element.
Note: Internet Explorer 10, Firefox, and Opera support the transform attribute. Internet Explorer 9 supports an alternative -ms-transform property (for 2D transforms only). Safari and Chrome support alternative -webkit-transform properties (3D and 2D transformations). Opera only supports 2D conversion.
CSS3 Transform attribute usage example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
Rendering:
The above is the detailed content of How to use transform attribute. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to achieve wave effect with pure CSS3? This article will introduce to you how to use SVG and CSS animation to create wave effects. I hope it will be helpful to you!

This article will show you how to use CSS to easily realize various weird-shaped buttons that appear frequently. I hope it will be helpful to you!

Two methods: 1. Using the display attribute, just add the "display:none;" style to the element. 2. Use the position and top attributes to set the absolute positioning of the element to hide the element. Just add the "position:absolute;top:-9999px;" style to the element.

In CSS, you can use the border-image attribute to achieve a lace border. The border-image attribute can use images to create borders, that is, add a background image to the border. You only need to specify the background image as a lace style; the syntax "border-image: url (image path) offsets the image border width inward. Whether outset is repeated;".

Implementation method: 1. Use the ":active" selector to select the state of the mouse click on the picture; 2. Use the transform attribute and scale() function to achieve the picture magnification effect, the syntax "img:active {transform: scale(x-axis magnification, y Axis magnification);}".

How to create text carousel and image carousel? The first thing everyone thinks of is whether to use js. In fact, text carousel and image carousel can also be realized using pure CSS. Let’s take a look at the implementation method. I hope it will be helpful to everyone!

In CSS3, you can use the "animation-timing-function" attribute to set the animation rotation speed. This attribute is used to specify how the animation will complete a cycle and set the speed curve of the animation. The syntax is "element {animation-timing-function: speed attribute value;}".

The animation effect in css3 has deformation; you can use "animation: animation attribute @keyframes ..{..{transform: transformation attribute}}" to achieve deformation animation effect. The animation attribute is used to set the animation style, and the transform attribute is used to set the deformation style. .
