Summary of the new feature of CSS3 (Transform)

Source: Internet
Author: User

Summary of the new feature of CSS3 (Transform)
Overview: the newly added Transform in CSS3 can change the coordinates of elements in the visible area (this change will not cause document rearrangement, only arrangement), shape, and some 3D deformation. combined with Animation (there will be a link later), it can achieve cool Animation; rotation: rotate supports a parameter with an angle value of 0-360deg # demo {transform: rotate (180deg ); /* To achieve rotation, the upper left corner will display */} scale in the lower right corner: scale supports two parameters (x, y). If y is not specified, the value of x is taken; 1 is normal, <1 is scaled,> 1 is amplified; # demo {transform: scale (1.2);/* 1.2 x/transform: scale (. 8);/* scale down to a normal 0.8 times */} scale provides two sub-Methods: scaleX and scaleY, which are used to set the zooming of x or y respectively; skew ): skew supports two parameters (x, y). The parameter type is angle (deg). If y is not specified, the default value is 0 (different from scaling). # demo {transform: skew (45deg);/* The text is tilted 45 ° to the left along the X axis */transform: skew (0, 45deg ); /* The text is tilted 45 ° down along the y axis */} if only x or y is set, you can directly use two submethods, skewX and skewY; translation (translate ): translate receives two parameters (x, y) as the translation distance. If the y value is not specified, the default value is 0, supports valid length units in all CSS (use translate to move elements without triggering shuffling, only re-painting); # demo {transform: translate (20px, 5vl ); /* Move 20 pixels to the left, and move the window height of 5% down */}. There are two sub-methods, translateX and translateY. A simple example is provided, and rotate is used; conclusion: Transform can be used to do a lot of cool things (skipping matrix, matrix3d didn't say ...) of course, don't die like me.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.