Application of css3--transform2d

Source: Internet
Author: User

Objective:

About CSS3, I think the most interesting thing is the 2D and 3D technology, which makes our web page instantly enriched, can let us do some cool and dazzling effects, such as Carousel. After a period of study, let me have a closer understanding of CSS3, in this warm so know new. Special thanks to Zhang Xin's technical blog.

In W3cschool, Transform:rotate () is found; Translate (23PX), except for elements such as matrix (n,n,n,n,n,n), are almost never used, since most of the properties are already available to meet our needs. In fact, all of the 2d,3d effect is to change the matrix () and get, if you master The Matrix () method, is to grasp the CSS3 in the heart of the cool hang-fried days effect.

In this statement, the following write code, do not add compatible browser properties, please add your own IE 9 (-ms-), Safari and Chrom (-webkit-), Opera (-o-), Firefox (-moz-);

1, displacement-translate (x, y)

Defines 2D transformations, moving elements along the x and Y axes, which can change the true coordinates of an element on the screen

The following general methods are used:

Div {  transform:translate (50px,100px);  /* or    Transform:translatex (50px);     */     }

Using matrices

Div {    transform:matrix (1,0,0,1,50,100);}

The first 4 values are fixed, the fifth one represents the value of the x-axis, and the sixth represents the value of the y-axis.

2, scaling-scale (x, y)

Defines the 2D transformation, changing the width and height of the element. is to zoom in and out of the element itself, but not to change the width and height of the element itself.

Div { transform: Scale(2.2,1); /* or Transform:scalex (2.2); Transform:scaley (1); */    }

Using matrices

Div {    transform:matrix (2.2,0,0,1,0,0);}

As you can see, scaling is the change of the first element and the fourth element.

  

Application of css3--transform2d

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.