Common styles of CSS animation effects animation

Common styles of CSS animation effects animation

animation

Define an animation:

/*Set a keyframe to define the action performed at each step of the animation*/
@keyframes mybox{
            0%{transform: translate(0,0);}
            25%{transform: translate(200px,0);}
            50%{transform: translate(200px,200px);}
            75%{transform: translate(0,200px);}
            100%{transform: translate(0,0);}
        }
/*Reference keyframes and set the execution style of the animation*/
animation: mybox 5s 1s infinite;

Note:

1. Return to the initial position after the animation ends.
2. from->0% to ->100%

animation-name: the name of the animation (must exist)

animation-duration: the duration of the animation

animation-delay: specifies how long it takes for the animation effect to appear

animation-iteration-count: defines the number of times the animation is executed

The default value is: 1; unlimited times: infinite

animation-timing-function: defines the animation effect animation-fill-mode:

none: default value; the style takes effect after a delay;
backwards: The style takes effect before the delay;
forwards: After the animation ends, it stops at the end position;
both: has the characteristics of backwards and forwards;

Summarize

This is the end of this article about the commonly used styles of CSS animation effects. For more content about commonly used styles of CSS animation, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope that everyone will support 123WORDPRESS.COM in the future!

<<:  VUE render function usage and detailed explanation

>>:  zabbix custom monitoring nginx status implementation process

Recommend

JavaScript Basics: Scope

Table of contents Scope Global Scope Function Sco...

How to create a simple column chart using Flex layout in css

The following is a bar chart using Flex layout: H...

Pure CSS custom multi-line ellipsis problem (from principle to implementation)

How to display text overflow? What are your needs...

CSS stacking and z-index example code

Cascading and Cascading Levels HTML elements are ...

Docker image optimization (from 1.16GB to 22.4MB)

Table of contents The first step of optimization:...

An enhanced screenshot and sharing tool for Linux: ScreenCloud

ScreenCloud is a great little app you didn’t even...

A brief discussion on the problem of forgotten mysql password and login error

If you forget your MySQL login password, the solu...

How to query and update the same table in MySQL database at the same time

In ordinary projects, I often encounter this prob...

Usage and principles of provide and inject in Vue3

Preface: When passing data between parent and chi...

Use CSS3 to implement button hover flash dynamic special effects code

We have introduced how to create a waterfall layo...

JavaScript function encapsulates random color verification code (complete code)

An n-digit verification code consisting of number...

Detailed examples of how to use the box-shadow property in CSS3

There are many attributes in CSS. Some attributes...

MySQL master-slave replication configuration process

Main library configuration 1. Configure mysql vim...

MySQL complete collapse query regular matching detailed explanation

Overview In the previous chapter, we learned abou...