In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to set the rotation center point of rotate in css3". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to set the rotation center point of rotate in css3".
In css3, you can set the rotation center point of the rotate with the "transform-origin" attribute, which changes the position of the conversion element, the first parameter sets the rotation position of the x-axis, the second parameter sets the y-axis rotation position, and the syntax is "transform-origin:x axis position y-axis position".
The operating environment of this tutorial: windows10 system, CSS3&&HTML5 version, Dell G3 computer.
How to set the center of rotation of rotate in css3
The rotate () function is a built-in function that rotates the element based on a given angle. You can set the angle according to degrees, scales, radians or corners.
Usage:
Rotate (angle)
Parameters: this function accepts a single parameter angle that represents the rotation angle. Positive and negative angles make the element rotate clockwise and counterclockwise, respectively.
The following example illustrates the rotate () function in CSS:
Example 1:
CSS rotate () function body {text-align:center;} H2 {color:green;} .transform:rotate _ image {transform:rotate (45deg);} GeeksforGeeks CSS rotate () function
Output:
The transform-Origin attribute allows you to change the location of the transformation element.
A 2D transformation element can change the X and Y axes of an element. 3D converts the element, and you can also change the Z axis of the element.
The syntax is:
Transform-origin: x-axis y-axis z-axis
X-axis defines where the view is placed on the X axis.
Y-axis defines where the view is placed on the Y axis.
Examples are as follows:
123#div1 {position: relative;height: 200pxtoswidth: 200pxtransposition margin: 100pxtranspaddingrelative;height 10pxborder: 1px solid black;} # div2 {padding:50px;position: absolute;border: 1px solid black;background-color: red;transform: rotate (45deg); transform-origin:20% 40% transmissionmstransform: rotate (45deg); / * IE 9 * /-ms-transform-origin:20% 40%; / * IE 9 * /-webkit-transform: rotate (45deg) / * Safari and Chrome * /-webkit-transform-origin:20% 40%; / * Safari and Chrome * /} HELLO
Output result:
Thank you for your reading, the above is the content of "how to set the rotation center point of rotate in css3". After the study of this article, I believe you have a deeper understanding of how to set the rotation center point of rotate in css3. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.