Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the css3 rotation like?

Shulou Source: shulou.com Published: 2022-06-02 06:23:48 09月30日 Update

This article mainly introduces "how css3 rotation is". In daily operation, I believe many people have doubts about how css3 rotation is. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "how css3 rotation is". Next, please follow the editor to study!

There are many cases of rotation in css3: 1, the rotation realized by the "rotateX ()" function is around the X axis; 2, the rotation realized by the "rotateY ()" function is around the Y axis; 3, the rotation realized by the "rotateZ ()" function is around the Z axis; and 4, the rotation realized by the "rotate ()" function is around the origin.

The operating environment of this tutorial: windows10 system, CSS3&&HTML5 version, Dell G3 computer.

Which axis does the css3 rotation rotate about?

In css, rotation can be rotated counterclockwise or around the X, Y, or Z axis, and different rotation styles correspond to different functions.

1. "rotate ()" function

Using the "rotate ()" function, you can rotate elements clockwise or counterclockwise.

Examples are as follows:

Div {margin:30px;width:200px;height:100px;background-color:yellow;/* Rotate div * / transform:rotate (9deg);-ms-transform:rotate (9deg); / * Internet Explorer * /-moz-transform:rotate (9deg); / * Firefox * /-webkit-transform:rotate (9deg); / * Safari and Chrome * /-o-transform:rotate (9deg); / * Opera * /} Hello World

Output result:

2. "rotateX ()" function

Using the "rotateX ()" function, you can rotate the element around the X axis. Examples are as follows:

Img {transform:rotatex (180deg);}

Output result:

3. "rotateY ()" function

Using the "rotateY ()" function, you can rotate the element around the Y axis, as shown in the following example:

Img {transform:rotateY (180deg);}

Output result:

4. "rotateZ ()" function

Using the "rotateZ ()" function, you can rotate the element around the Z axis. Examples are as follows:

Img {transform:rotateZ (180deg);}

Output result:

At this point, the study of "how css3 rotation is" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Functions elements examples results learning output different clockwise more counterclockwise help practical next origin multiple situations tutorials articles methods styles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Technology Microsoft Shulou Tech Info MariaDB