Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the methods of 2D transformation of CSS style changes

2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces the relevant knowledge of "what are the methods of 2D transformation of CSS style change". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

2D conversion

1)。 Element displacement translate (left, top edge)

Div {transform: translate (50pxMagol 100px);-ms-transform: translate (50pxMagne 100px); / * IE 9 * /-webkit-transform: translate (50pxMagol 100px); / * Safari and Chrome * /-o-transform: translate (50pxMagol 100px); / * Opera * /-moz-transform: translate (50pxMagol 100px); / * Firefox * /}

2)。 Element rotation rotate (Angle)

Div {transform: rotate (10deg);-ms-transform: rotate (10deg); / * IE 9 * /-webkit-transform: rotate (10deg); / * Safari and Chrome * /-o-transform: rotate (10deg); / * Opera * /-moz-transform: rotate (10deg); / * Firefox * /} rotate () scale () skew () matrix ()

3)。 Element scale scale (width multiple, height multiple)

Div {transform: scale (1Mague 2);-ms-transform: scale (1Magne2); / * IE 9 * /-webkit-transform: scale (1Power2); / * Safari and Chrome * /-o-transform: scale (1Magol 2); / * Opera * /-moz-transform: scale (1Mague 2); / * Firefox * /}

4)。 Element flips at a given angle skew (xrem y)

Div {transform: skew (13degmagere 21deg);-ms-transform: skew (13degmagne 21deg); / * IE 9 * /-webkit-transform: skew (13deggery 21deg); / * Safari and Chrome * /-o-transform: skew (13degmagee 21deg); / * Opera * /-moz-transform: skew (13degmagee 21deg); / * Firefox * /}

5)。 Combine all the previous methods into matrix ()

Div {transform:matrix (1.32, 0.32, 0.22, 0.54, 0.65);-ms-transform:matrix (1.32, 0.32, 0.22, 0.54, 0.65); / * IE 9 * /-moz-transform:matrix (1.32, 0.32, 0.42, 0.54, 0.65); / * Firefox * /-webkit-transform:matrix (1.3, 0.32, 0.32, 0.52, 0.54, 0.65). / * Safari and Chrome * /-o-transform:matrix (1.3 Opera * /} defines a matrix of six numbers

6) transition from 2D to 3D

Div {transform:rotate (1deg);-ms-transform:rotate (1deg); / * IE 9 * /-moz-transform:rotate (1deg); / * Firefox * /-webkit-transform:rotate (1deg); / * Safari and Chrome * /-o-transform:rotate (1deg) / * Opera * /} it contains all 2D and 3D methods, and you can individually set the x direction y-axis value of each method, for example: rotate (angle) defines 2D rotation and specifies the angle in the parameters. Test rotate3d definition 3D rotation rotateX (angle) definition 3D rotation rotateY (angle) definition along Y axis 3D rotation rotateZ (angle) definition 3D rotation along Z axis other uses are similar, but there is another difference: perspective (n) defines a perspective view for 3D transformation elements. " What are the methods of 2D transformation of CSS style changes? this is the end of the introduction. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report