How to achieve element transition effect in css3

WBOY
Release: 2022-04-28 17:17:47
Original
2834 people have browsed it

In CSS3, you can use the transition attribute to achieve element transition effects. This attribute can set the attribute name, transition time, transition speed and when the transition starts. The syntax is "element {transition: attribute name Time speed curve delay}".

How to achieve element transition effect in css3

The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.

How to achieve element transition effect in css3

The transition attribute is an abbreviated attribute, used to set four transition properties:

  • transition-property specified settings The name of the transition effect's CSS property.

  • transition-duration specifies how many seconds or milliseconds it takes to complete the transition effect.

  • transition-timing-function Specifies the speed curve for the speed effect.

  • transition-delay Defines when the transition effect starts.

The syntax is:

transition: property duration timing-function delay;
Copy after login

The example is as follows:

    

请把鼠标指针移动到蓝色的 div 元素上,就可以看到过渡效果。

注释:本例在 Internet Explorer 中无效。

Copy after login

Output result:

How to achieve element transition effect in css3

(Learning video sharing:css video tutorial)

The above is the detailed content of How to achieve element transition effect in css3. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!