当前位置:网站首页>Rotation of 2D conversion, transform origin of 2D conversion center point and scale of 2D conversion
Rotation of 2D conversion, transform origin of 2D conversion center point and scale of 2D conversion
2022-07-26 13:48:00 【Dummerd】
Catalog
One .2D The rotation of transformation rotate
Two .2D Convert center point transform-origin
3、 ... and .2D Scaling of transformation scale
One .2D The rotation of transformation rotate
2D Rotation refers to making the element rotate clockwise or counterclockwise in the plane
1. grammar
transform:rotate( Degrees )
2. a key
rotate It's the same as the degree , The unit is deg such as rotate(45deg)
The angle is timing , Clockwise , Negative time , For counter clockwise
The default center point of rotation is the center point of the element
Two .2D Convert center point transform-origin
We can set the center point of element transformation
1. grammar
transform-origin:X Y;
2. a key
Note the following parameters X and Y Use spaces separate
XY The center point of the default transformation is the center point of the element (50% 50%)
Can also give x y Set pixel or orientation nouns (top bottom left right center)
3、 ... and .2D Scaling of transformation scale
Zoom is to zoom in and out , As long as you add this attribute to an element, you can control whether it zooms in or out
1. grammar
transform:scale(x,y)
2. Be careful
Among them x and y Separated by commas
transform:scale(1,1) Double the width and height , It's equivalent to no magnification
transform:scale(2,2) Both width and height are enlarged 2 times
transform:scale(2) Just write one parameter , The second parameter is the same as the first parameter , amount to scale(2,2)
transform:scale(0.5,0.5) narrow
scale The biggest advantage of : You can set the conversion center point scaling , By default, it is zoomed with the center point , And it doesn't affect the other boxes
1. Using multiple transformations at the same time , The format for :transform:translate() rotate() scale()... etc.
2. The order affects the effect of the conversion .( First rotate and change the orientation of the coordinate axis )
3. When we have displacement and other properties at the same time , Remember to put the displacement first
5、 ... and .2D Conversion summary
1. transformation transform Our simple understanding is deformation , Yes 2D and 3D Points
2.2D Move translate(x,y) The biggest advantage is that it does not affect other boxes , The internal parameters are %, Is calculated relative to its own width and height
3. You can write it separately translateX(x) and translateY(y)
4.2D rotate rotate( Degrees ) You can rotate elements Degree units are deg
5.2D The zoom scale(x,y) The parameters are numbers, not units It can be a decimal The biggest advantage is that it does not affect other boxes
6. Set the conversion center point trans-origin:x y; Parameters can be percentages , Pixel or noun of position
7. When we write comprehensively , When there are displacement and other properties at the same time , Remember to put the displacement first
边栏推荐
- Docker integrates the redis sentinel mode (one master, two slave and three sentinels)
- Re bet overseas: Alibaba, jd.com and SF again fight for "internal power"
- Segmentation fault (core dumped)
- Official announcement! Edweisen group and Baidu xirang reached a deep co creation cooperation
- 估值15亿美元的独角兽被爆裁员,又一赛道遇冷?
- Uncover the secret of white hat: 100 billion black products on the Internet scare musk away
- Unicode file parsing methods and existing problems
- This article explains the FS file module and path module in nodejs in detail
- [oauth2] VIII. Configuration logic of oauth2 login -oauth2loginconfigurer and oauth2clientconfigurer
- JUC总结
猜你喜欢

JS page turning, kkpager.js page turning

估值15亿美元的独角兽被爆裁员,又一赛道遇冷?

力扣------字符串中的单词数

Flutter multi-channel packaging operation

WPS凭什么拒绝广告?

Seven steps to copywriting script ---- document team collaborative management

Win11+VS2019配置YOLOX

2022年,我们只用一个月就“送走”了这么多互联网产品

JSON data transfer parameters & date type parameter transfer

Ultimate doll 2.0 | cloud native delivery package
随机推荐
带你熟悉云网络的“电话簿”:DNS
Ros2 learning (1) introduction to ros2
Cavans realizes Static Rolling barrage
.net6与英雄联盟邂逅之——根据官方LCU API制作游戏助手
Abstract factory and its improvement examples
Code cloud, which officially supports the pages function, can deploy static pages
Pass parameters to the routing component
Unicode file parsing methods and existing problems
Docker container MySQL enables binlog and scheduled backup
Subscription and publication of messages
B+ tree selection index (2) -- MySQL from entry to proficiency (23)
LCL三相pwm整流器(逆变器)
Codeforces round 810 (Div. 2) [competition record]
With frequent data leakage and deletion events, how should enterprises build a security defense line?
Canvas upload image Base64 with cropping function jcrop.js
Unicorn, valued at $1.5 billion, was suddenly laid off, and another track was cold?
消息的订阅和发布
Brief introduction of reflection mechanism
Force deduction ----- the number of words in the string
404 pages and routing hooks