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

How to realize the effect of Circular rotation by css3

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces the relevant knowledge of "how to achieve the effect of circular rotation in css3". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to achieve the effect of circular rotation in css3" can help you solve the problem.

Method: 1, use "border-radius:100%" to set the element as a circle; 2, use "@ keyframes name {100% {transform:rotate (360deg);}}" to animate the element; 3, use "animation: name time" to bind the element animation effect.

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

How to realize the effect of circular rotation by css3

Border-radius allows you to set the outer border fillet of an element. Determine a circle when one radius is used and an ellipse when two radii are used. The intersection of the circle and the border forms a fillet effect.

Using the @ keyframes rule, you can create animations.

Animations are created by gradually changing CSS style settings from one to another.

You can change the settings of the CSS style several times during animation.

The specified change occurs with%, or the keywords "from" and "to", which are the same as 0% to 100%.

0% is the beginning animation and 100% is when the animation is complete.

For optimal browser support, you should always define selectors of 0% and 100%.

The syntax is:

@ keyframes animationname {keyframes-selector {css-styles;}}

The syntax for the animation attribute is:

Animation: name duration timing-function delay iteration-count direction fill-mode play-state

Animation-name specifies the name of the Keyframe to bind to the selector

Animation-duration animation specifies how many seconds or milliseconds it takes to complete

How animation-timing-function animates how to complete a cycle

Animation-delay sets the delay interval before the animation starts.

Animation-iteration-count defines the number of times the animation is played.

Animation-direction specifies whether the animation should be played backwards in turn.

Animation-fill-mode specifies the style to be applied to the element when the animation is not played (when the animation is complete, or when the animation has a delay that does not start playing).

Animation-play-state specifies whether the animation is running or paused.

Examples are as follows:

123 # example1 {background:#dddddd;width:100px;height:100px;border-radius:100%;text-align:center;animation:fadenum 5s;} @ keyframes fadenum {100% {transform:rotate (360deg);}} this is a circle

Output result:

This is the end of the content about "how to achieve the effect of circular rotation in css3". Thank you for your reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

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