CSS3 Learning Summary 9--CSS3 Transition

Source: Internet
Author: User

CSS3 transition

With CSS3, we can add an effect to an element when the element is transformed from one style to another without using Flash animation or JavaScript.

Transition properties
Properties Description CSS
Transition Shorthand property, which is used to set four transition properties in one property. 3
Transition-property Specifies the name of the CSS property that the transition is applied to. 3
Transition-duration Defines the time that the transition effect takes. The default is 0. 3
Transition-timing-function A time curve that specifies the transition effect. The default is "ease". 3
Transition-delay Specifies when the transition effect begins. The default is 0. 3

The following example sets all the transition properties:

Instance

Use all of the transition properties in one example:

div{transition-property:width;transition-duration:1s;transition-timing-function:linear;transition-delay:2s;/* Firefox 4 */-moz-transition-property:width;-moz-transition-duration:1s;-moz-transition-timing-function:linear;- moz-transition-delay:2s;/* Safari and Chrome */-webkit-transition-property:width;-webkit-transition-duration:1s;- webkit-transition-timing-function:linear;-webkit-transition-delay:2s;/* Opera */-o-transition-property:width;-o- Transition-duration:1s;-o-transition-timing-function:linear;-o-transition-delay:2s;}

  

Abbreviated instance of Transition instances

The transition effect is the same as the example above, but uses the shorthand transition property:

div{transition:width 1s linear 2s;/* Firefox 4 * *
-moz-transition:width 1s linear 2s;/* Safari and Chrome * *
-webkit-transition:width 1s linear 2s;/* Opera * *
-o-transition:width 1s linear 2s;

}

  

CSS3 Learning Summary 9--CSS3 Transition

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.