Use of css3 transition attribute_html/css_WEB-ITnose
Jun 24, 2016 pm 12:00 PM
Transition is to smoothly transition an attribute from one attribute value to another within a specified time to achieve animation effects.
This attribute is generally used with: hover
Let’s look at an example: Place the mouse on a div, and after 0.2 seconds, the background color of the div element will change to yellow in one second. The change method is linear
1 div{ background-color:red; transition:background-color 1s linear 0.2s;}2 div:hover{ background-color:yellow;}
<div>思思博士</div>
Before the mouse was placed:
The change process 0.2s after the mouse was placed:
The final effect when the mouse is placed on it:
Seeing how everyone uses this attribute here, you should have a good idea.
For this attribute, each parameter has a corresponding attribute name, which means that this attribute can be split and written.
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;}

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to get integer literal properties in Python without SyntaxError?

Python's dir() function: View the properties and methods of an object

How to rename properties of JSON using Gson in Java?

What to do if Win11 disk properties are unknown

Methods and examples of dynamically adding attributes using the Vue.set function

CSS gradient animation properties: transition and background-image

What is the role of pageXOffset attribute in JavaScript?
