In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "how to set the rotation point position in css3". In the daily operation, I believe many people have doubts about how to set the rotation point position in css3. The editor consulted all kinds of materials and sorted out a simple and easy-to-use operation method. I hope it will be helpful to answer the doubts about "how to set the rotation point position in css3". Next, please follow the editor to study!
In css, you can use the "transform-Origin" attribute to set the position of the rotation point of the element, which allows you to change the position of the converted element, and you can set the position between the converted element and the X, Y, and Z axes, respectively. The syntax is "transform-origin:X axis direction Y axis direction Z axis direction;"
The operating environment of this tutorial: windows10 system, CSS3&&HTML5 version, Dell G3 computer.
How to set the position of rotation point by css3
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.
When the transform-origin property is not set, the rotation, shift, scaling and other operations of the CSS deformation are all deformed at the center of the element (deformation origin / center point). The transform-origin attribute in CSS3 is used to set the base point position of the rotating element. Familiar with the use of transform-origin and combined with CSS3 animation, the element can be rotated along a certain base point, displacement, and so on.
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:
At this point, the study on "how to set the rotation point in css3" 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!
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.