【问题标题】:How to continuously rotate an icon on hover? [closed]如何在悬停时连续旋转图标? [关闭]
【发布时间】:2021-03-20 12:27:52
【问题描述】:

图标会旋转 3-4 秒,但在悬停时不会连续旋转。现在它在添加更改后正在旋转。请帮忙。

【问题讨论】:

标签: javascript html


【解决方案1】:

试试这个,希望对你有用

<!DOCTYPE html>
<html>

  <head>
    <style>
    i:hover {
      animation: rotation 3s infinite linear;
    }
    
    @keyframes rotation {
      from {
        transform: rotate(0deg);
      }
      to {
        transform: rotate(359deg);
      }
    }
    </style>
    <title>My Project</title>
  </head>
  <body>
    <div>
    <i class="fa fa-times"/>
    </div>
 </body>

</html>

【讨论】:

  • 不工作。仍然工作 3 到 4 秒
  • 您可以添加一些 HTML 并将其转换为 sn-p 以便我们可以看到它正在运行吗?
  • 我一定会这样做
  • 这也是重复问题的答案所使用的相同技术...
  • 谢谢你 Vardana Bhanot。它现在可以工作了
猜你喜欢
  • 1970-01-01
  • 2021-08-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-03-27
  • 2011-12-20
  • 2014-07-04
  • 1970-01-01
相关资源
最近更新 更多