当前位置:网站首页>Plane conversion (displacement, rotation, scaling)
Plane conversion (displacement, rotation, scaling)
2022-07-27 04:52:00 【Front end development boy】
Plane transformation concept ( The goal is : Use transform Attribute implements the of the element Displacement 、 rotate 、 The zoom Equal effect )
1、 Displacement ( The goal is : Use translate Achieve element displacement effect )
grammar :transform:translate( Horizontal movement distance , Vertical movement distance );
Value ( Both positive and negative ): Pixel unit value ; percentage ( The reference is the size of the box itself ) Be careful :(x Right axis ,Y The shaft is straight down )
skill : translate() If only one value is given , Express X Moving distance in axis direction ;
Set the moving distance in a certain direction separately :translateX() & translY()
2.1 Plane conversion rotation ( The goal is : Use rotate Achieve element rotation effect )
grammar :transform:rotate( angle ); Be careful : The unit of angle is deg
skill : The value can be positive or negative ( just - Clockwise rotation ; negative - Counter clockwise rotation )
<style>
img {
width: 250px;
margin: 100px;
transition: all 0.5s;
}
img:hover {
transform: rotate(360deg);
}
</style>
<body>
<img src="./images/rotate.png" alt=""> // Insert a picture
</body>
2.2 Change the origin ( The goal is : Use transform-origin Attribute change conversion origin ) This attribute is added to your element
grammar : The default dot is the center point of the box ; transform-origin: Origin horizontal position The vertical position of the origin ;
Value : Position NOUN (left、top、right、bottom、center)
Pixel unit value
percentage ( Calculate the size of the box itself )
2.3 Multiple conversion ( The goal is : Use transform Compound attribute Realize multi-modal transformation )
skill :transform:translate() rotate();
- The zoom ( The goal is : Use scale Change the size of an element )
grammar :transform:scale(x Axis scaling factor ,y Axis scaling factor );
skill : In general , Just for scale Set a value , Express x Axis and y Axis scaling
transform:scale( Zoom multiple );
z-index Property to set the stacking order of elements . Elements with a higher stacking order are always in front of elements with a lower stacking order .
4、 The gradient ( The goal is : Use background-image Change the background color gradient )
grammar :background-image: linear-gradient(
transparent,// Start gradient ( colourless )
rgba(0,0,0,0.6) // End gradient ( Use rgba Better )
);
边栏推荐
- [final review of software engineering] knowledge points + detailed explanation of major problems (E-R diagram, data flow diagram, N-S box diagram, state diagram, activity diagram, use case diagram...)
- Solution to the third game of 2022 Hangzhou Electric Multi school league
- 华为入局商用市场:趋势使然,挑战颇多
- 2022杭电多校联赛第三场 题解
- 题目:有一个已经按升序排好序的数组。现输入一个数,要求按原来的规律将它插入数组中。
- Final review of management information system
- STM32 cubeMX HAL-----PWM—改变频率
- TCP's three handshakes and four waves
- Shell programming enhancements
- The data in echart histogram is displayed at the top of the chart
猜你喜欢
![Text processing tool in shell, cut [option parameter] filename Description: the default separator is the built-in variable of tab, awk [option parameter] '/pattern1/{action1}filename and awk](/img/ed/941276a15d1c4ab67d397fb3286022.png)
Text processing tool in shell, cut [option parameter] filename Description: the default separator is the built-in variable of tab, awk [option parameter] '/pattern1/{action1}filename and awk

JS day 2 (variables, variable usage, naming rules, syntax extensions)

CEPH operation

ceph操作

利用Power Automate,轻松下载Power BI报告中的数据

Chapter 6: cloud database

redux三大核心

JS第二天(变量、变量的使用、命名规则、语法扩展)

双向重发布实验

Explain left value, right value, left value reference and right value reference in detail
随机推荐
Open the door of programming
Cloudcompare & PCL matching point median (or standard deviation) distance suppression
Maximum value, minimum value, bubble sort in the array
Introduction to regular expressions of shell, general matching, special characters: ^, $,., * Character range (brackets): [], special characters: \, matching mobile phone number
Pinia uses the whole process, including state, actions, getters, and how to deconstruct, respond, and various methods used by actions
How does novice Xiaobai learn to be we media?
C language - two dimensional array, pointer
Wechat applet rotation map
Three cores of Redux
JS第二天(变量、变量的使用、命名规则、语法扩展)
redux三大核心
关于gorm的BeforeDelete钩子方法不生效的问题
Two way republication experiment
Vscode opens a new chapter in the visualization of pull request update code branches
【day02】数据类型转换、运算符、方法入门
数组中的最大值,最小值,冒泡排序
【动态规划百题强化计划】11~20(持续更新中)
The price reduction of iphone13 is just a show. Consumers are waiting for iphone14
ELS square display principle
5.component动态组件的展示