Method: 1. Use the animation attribute and "@keyframes" rule to define a rotation animation for the element; 2. Use the "animation-duration" attribute to set the rotation time of the control element. The syntax is "element {animation-duration" :time;}".
The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.
How to control rotation time in css3
In css, you can use the animation attribute to bind animation effects to elements and use the "@keyframes" rule Specify animation actions for elements.
Use the animation-duration attribute to define the time required for the animation to complete a cycle, in seconds or milliseconds.
The example is as follows:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style> .div1{ width:100px; height:100px; background-color:pink; animation:fadenum; animation-duration:10s; } @keyframes fadenum{ 100%{transform:rotate(360deg);} } .div2{ width:100px; height:100px; background-color:pink; animation:fadenum1; animation-duration:5s; } @keyframes fadenum1{ 100%{transform:rotate(360deg);} } </style> </head> <body> <div class="div1"></div><br><br> <div class="div2"></div> </body> </html>
Output result:
(Learning video sharing: css video tutorial)
The above is the detailed content of How to control rotation time in css3. For more information, please follow other related articles on the PHP Chinese website!

Here's a container with some child elements:

Flyout menus! The second you need to implement a menu that uses a hover event to display more menu items, you're in tricky territory. For one, they should

"The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect."- Tim Berners-Lee

In this week's roundup: datepickers are giving keyboard users headaches, a new web component compiler that helps fight FOUC, we finally get our hands on styling list item markers, and four steps to getting webmentions on your site.

The short answer: flex-shrink and flex-basis are probably what you’re lookin’ for.

In this week's look around the world of web platform news, Google Search Console makes it easier to view crawled markup, we learn that custom properties

The IndieWeb is a thing! They've got a conference coming up and everything. The New Yorker is even writing about it:


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Dreamweaver Mac version
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment