An example analysis of transition attribute in CSS3

Source: Internet
Author: User

I. Description

1.1 Definitions and usage

The Transition property is a shorthand property for setting four transition properties:

Transition-property: Specifies the name of the CSS property that sets the transition effect.

Transition-duration: Specifies how many seconds or milliseconds to complete the transition effect.

Transition-timing-function: Speed curve that specifies the speed effect.

Transition-delay: Defines when the transition effect starts.

1.2 Syntax

Transition:property duration timing-function delay;

1.3 transition-timing-function

1.3.1 Syntax

Transition-timing-function:linear|ease|ease-in|ease-out|ease-in-out|cubic-bezier (N,n,n,n);

1.3.2 Description

Linear: Specifies the transition effect (equal to Cubic-bezier (0,0,1,1)) that starts at the same speed to the end. Ease: A transition effect (Cubic-bezier (0.25,0.1,0.25,1)) that specifies a slow start and then a slow end. Ease-in: Specifies a transition effect (equal to Cubic-bezier (0.42,0,1,1)) that starts at a slow speed. Ease-out: Specifies a transition effect (equal to Cubic-bezier (0,0,0.58,1)) that ends at a slow speed. Ease-in-out: Specifies a transition effect (equal to Cubic-bezier (0.42,0,0.58,1)) that starts and ends at a slow speed. Cubic-bezier (N,n,n,n): Defines its own value in the Cubic-bezier function. The possible values are numbers between 0 and 1.

Ii. examples

<style>. transition-example{width:500px;        height:370px;        Background: #ccc;    padding:10px 0;        }. transition-example:hover>p{margin-left:90%;        Transform:rotate (360DEG);    border-radius:5px;        }. transition-example>p{width:50px;        height:50px;        Text-align:center;        margin:10px 0;        Background-color:blue;    Color: #fff;    }. linear{Transition:all 5s linear;    }. ease{Transition:all 5s ease;    }. ease-in{Transition:all 5s ease-in;    }. ease-out{Transition:all 5s Ease-out;    }. ease-in-out{Transition:all 5s Ease-in-out;    }. cubic-bezier{Transition:all 5s Cubic-bezier (0.42,0,0.58,1); } </style><p class= "Transition-example" > <p class= "linear" >linear</p> <p class= "Ease" & gt;ease</p> <p class= "ease-in" >ease-in</p> <p class= "Ease-out" >ease-out</p> <p class= "ease-in-out" >ease-in-out</p> <p class= "Cubic-bezier" >cubic-bezier</p& Gt;</p>
lineareaseease-inease-outease-in-outcubic-bezier 
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.