Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the use of @ keyframes in css

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the use of @ keyframes in css. It is very detailed and has a certain reference value. Friends who are interested must finish it!

Css@keyframes

Purpose: with the @ keyframes rule, you can create animations.

Description:

The principle of creating animation is to gradually change one set of CSS styles into another. You can change this CSS style many times during the animation process. Specify the time when the change occurs as a percentage, or through the keywords "from" and "to", which is equivalent to 0 and 100%. 0% is the start time of the animation and the end time of 100% of the animation. For optimal browser support, you should always define 0% and 100% selectors.

Note: use animation attributes to control the appearance of the animation and bind the animation to the selector.

Example of using css@keyframes

Div

{

Width:100px

Height:100px

Background:red

Position:relative

Animation:mymove5sinfinite

-moz-animation:mymove5sinfinite;/*Firefox*/

-webkit-animation:mymove5sinfinite;/*SafariandChrome*/

-omuranimationvir mymove5sinfiniteschaft /

}

@ keyframesmymove

{

0% {top:0px;}

25% {top:200px;}

75% {top:50px}

100% {top:100px;}

}

@-moz-keyframesmymove/*Firefox*/

{

0% {top:0px;}

25% {top:200px;}

75% {top:50px}

100% {top:100px;}

}

@-webkit-keyframesmymove/*SafariandChrome*/

{

0% {top:0px;}

25% {top:200px;}

75% {top:50px}

100% {top:100px;}

}

@-o-keyframesmymove/*Opera*/

{

0% {top:0px;}

25% {top:200px;}

75% {top:50px}

100% {top:100px;}

}

Note: this example is not valid in InternetExplorer.

The above is all the content of the article "what is the use of @ keyframes in css". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report