CSS3 Three Kings Transition, transform, animation

Source: Internet
Author: User

Three Kings Transition: transition, Transform: Metamorphosis, Animation: Animation 1.transform morphing

Any deformation can be transition, a transform write multiple spaces separated, separate write may be overwritten,

Want to achieve 3d effect to add depth of field to the parent element eg: perspective:500px; Perspective-origin

<1> transform:rotate (90DEG)

Meaning is clockwise ' rotation ' 90 degrees, DEG is the unit degree can be negative, Rotatex (45deg) x axis rotation 45 degrees, is backward, negative forward, rotatey the same, with transform-origin:0% 0px; Two parameters for X, maximum depth of field for Y axis

<2>transform:scale (0.1,0.1) means scaling 0.1 times times, two parameters are the X, Y axis zoom multiples, can also be disassembled ScaleX, ScaleY,

<3>transform:skew (10deg,10deg) means that the element is inclined to cut, as if the square into parallelogram, two parameters are the x-axis oblique cutting degrees, y-axis oblique cut degrees, can also be opened to write Skewx,skewy

<4>transform:translatex (300px); It means moving from the x-axis to 300px or Translatey, Z.

Transform:translate3d (100px,200px,300px);

<5> transform-style:preserve-3d; when a composition (internal 3D) isto be rotated, then be sure to add this attribute, plus the inner small element of the 3D changes will be retained

        

eg! :

Not visible on back

1 Backface-visibility:hidden;

like two cards back-to-back pasted together,baby from -180 → 0 , xiaoming from 0 →

1 <div>

2

3

4 </div>

2.trasotion transitions It's worth noting that the transition takes time to prepare!!

transition:all 1s ease 0s; It's simple, efficient, good.

3.animation

To use an animation, you must first @-webkit-keyframes define the keyframe to define the initial sample and the result sample.

Call animation within an element

Animation:gogo 10s linear 0s alternate forwards;

Parameters Gogo Animation name, custom, total length of 10s animation, linear animation cache effect, OS delay time, if multiple times only first time delay, 10 represents the number of movements infinite represents the infinite times alternate represents whether or not to move back and forth, if written is to come Back to the movement, forwards represents whether to stay in place after the movement, wrote the representative to stay in situ

Definition of animation 1: Meaning how much animation is changing

@-webkit-keyframes gogo{

0%{

Write the amount of change here

}

50%{

}

100%{

}

}

Animation definition 2:form to from what into what

@-webkit-keyframe gogo{

form{

}

to{

}

}

CSS3 Three Kings Transition, transform, animation

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.