Use of the Transition property of the CSS3

Source: Internet
Author: User

Transition is an animation effect that smoothly transitions an attribute from one property value to another for a specified period of time.
This property is typically paired with: hover

Here is an example: the mouse on the Div, 0.2s after the background color of the div element with a second time into yellow, the change is linear

1 Div { background-color:red; transition:background-color 1s linear 0.2s;} 2 Div:hover { Background-color:yellow;}
< Div > Dr. Sisi </div>

Before the mouse is put up:

Mouse on the 0.2s after the change process:

The final effect of the mouse put up:

See here everyone on the use of this attribute, the heart should have a bottom.

For this property, each parameter has a corresponding property name, which means that the property can be disassembled.

Non-abbreviated form:

1 /*div{background-color:red; transition:background-color 1s linear 0.2s;}*/2 Div{Background-color:Red;Transition-property:Background-color;transition-duration:1s;transition-timing-function:Linear;Transition-delay:0.2s}3 Div:hover{Background-color:Yellow;}

Transition can also transition multiple effects.

1 Div { background-color:red; color:black; height:50px; transition:background-color 1s linear,color 1s linear,height 1s linear;} 2 3 Div:hover { Background-color:yellow; color:#F00; height:100px;}

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.