The attributes used in css3 transition are: 1. transition; 2. transition-property; 3. transition-duration; 4. transition-timing-function; 5. transition-delay.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
CSS3 Transition is the effect of an element gradually changing from one style to another.
To achieve this, two things must be specified:
Specify the CSS property to add the effect
Specify the effect duration.
Through the transition attribute, web front-end developers can achieve simple animation interaction effects without JavaScript. To achieve this, one thing must be implemented, that is, the specified effect duration.
css3 transition property
Property
Description
CSS
transition
Abbreviation attribute, used to set four transition attributes in one attribute.
3
transition-property
Specifies the name of the CSS property that applies the transition.
3
transition-duration
Define how long the transition effect takes. The default is 0.
3
transition-timing-function
Specifies the time curve of the transition effect. The default is "ease".
3
transition-delay
Specifies when the transition effect starts. The default is 0.
3
Composite attributes
## Of these four sub-attributes of transition, only is a required value and cannot be 0. Among them, and are both times. When two times occur at the same time, the first is , and the second is ; when there is only one time, it is , and is the default value 0
[Note] The four sub-properties of transition cannot be separated by commas, but can only be separated by spaces. Because the ones separated by commas represent different attributes (the transition attribute supports multi-value, the multi-value part will be introduced later); and the ones separated by spaces represent four sub-attributes about transition of different attributes.
transition-propertyThe attribute specifies the nametransition effect of the CSS attribute (the transition effect will start the change of the specified CSS attribute). none: no style is specified, all: default value, indicating that all styles of the specified element support the transition-property attribute. <transition-property>: transitionable style, you can write multiple styles separated by commas.
Note: Always specify the
transition-duration attribute, otherwise the duration is 0 and the transition will have no effect.
1), transitionable styles
Not all CSS style values can be transitioned, only attributes with intermediate values have transition effects, as follows
transition-duration attribute specifies the time it takes to complete the transition effect ( in seconds or milliseconds). Default value: 0s.
[Note]This attribute cannot be negative. [Note] If this attribute is 0s, it is the default value, if it is 0, it is an invalid value. So you must bring the unit. [Note] When the value is a single value, that is, all transition attributes correspond to the same time; when the value is multi-value, the transition attributes correspond to the duration in order. 3. Transition-timing-function
transition-timing-functionThe attribute specifies the speed of the switching effect. It can take several values. Default value: ease.
Value
Description
##linear
is specified in The transition effect starts and ends at the same speed, that is, uniform speed. (Equal to cubic-bezier(0,0,1,1)).
ease
Specifies the transition effect that starts slowly, then becomes faster, and then ends slowly (cubic-bezier(0.25,0.1,0.25,1)).
ease-in
Specifies a transition effect that starts at a slow speed (equal to cubic-bezier(0.42,0,1,1)).
ease-out
Specifies a transition effect that ends at a slow speed (equal to cubic-bezier(0,0,0.58,1)).
ease-in-out
Specifies a transition effect that starts and ends at a slow speed (equal to cubic-bezier(0.42,0,0.58,1)).
cubic-bezier(n,n,n,n)
Define your own values in the cubic-bezier function. Possible values are between 0 and 1.
The above is the detailed content of What properties does css3 transition use?. For more information, please follow other related articles on the PHP Chinese website!
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How to achieve wave effect with pure CSS3? This article will introduce to you how to use SVG and CSS animation to create wave effects. I hope it will be helpful to you!
Two methods: 1. Using the display attribute, just add the "display:none;" style to the element. 2. Use the position and top attributes to set the absolute positioning of the element to hide the element. Just add the "position:absolute;top:-9999px;" style to the element.
In CSS, you can use the border-image attribute to achieve a lace border. The border-image attribute can use images to create borders, that is, add a background image to the border. You only need to specify the background image as a lace style; the syntax "border-image: url (image path) offsets the image border width inward. Whether outset is repeated;".
Implementation method: 1. Use the ":active" selector to select the state of the mouse click on the picture; 2. Use the transform attribute and scale() function to achieve the picture magnification effect, the syntax "img:active {transform: scale(x-axis magnification, y Axis magnification);}".
How to create text carousel and image carousel? The first thing everyone thinks of is whether to use js. In fact, text carousel and image carousel can also be realized using pure CSS. Let’s take a look at the implementation method. I hope it will be helpful to everyone!
In CSS3, you can use the "animation-timing-function" attribute to set the animation rotation speed. This attribute is used to specify how the animation will complete a cycle and set the speed curve of the animation. The syntax is "element {animation-timing-function: speed attribute value;}".
The animation effect in css3 has deformation; you can use "animation: animation attribute @keyframes ..{..{transform: transformation attribute}}" to achieve deformation animation effect. The animation attribute is used to set the animation style, and the transform attribute is used to set the deformation style. .