请添加图片描述


主要思路

代码

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>流光按钮</title>
  <style>
    .wrapper{
      width: 900px;
      height: 800px;
      background: #111111;
      padding: 60px;
    }

    .item{
      margin: auto;
      position: relative;
      --size: 150px;
      height: var(--size);
      width: var(--size);
      background-color: rgba(224, 224, 224, 0.774);
      border-radius: 50%;
      border: 3px solid rgba(255, 255, 255, 0.911);
      color: rgb(255, 0, 179);
      font-weight: 800;
      line-height: var(--size);
      text-align: center;
      font-size: 30px;
    }

    .item::before{
      content: "";
      position: absolute;
      inset: -7px;
      border-top: 11px solid red;
      border-radius: 50%;
      filter: drop-shadow(1px 1px 5px red);
      z-index: 1;
      transition: all 1s;
      animation: 2.3s linear infinite spin;
    }

    .item::after{
      content: "";
      position: absolute;
      inset: -7px;
      border-bottom: 11px solid rgb(0, 60, 255);
      border-radius: 50%;
      filter: drop-shadow(1px 1px 5px rgb(0, 140, 255));
      z-index: 2;
      transition: all 1s;
      animation: 2.3s linear infinite spin;


    }

    @keyframes spin {
      0%{
        transform: rotate(0deg);
        border-width: 3px;
        opacity: .66;
      }
      50%{
        opacity: .9;
        border-width: 8px;
      }
      100%{
        transform: rotate(360deg);
        opacity: .66;
        border-width: 3px;
      }
      
    }
  </style>
</head>
<body>
  

  <div class="wrapper" >
    <div class="item">Hello</div>
  </div>
</body>
</html>

原文地址:https://blog.csdn.net/qq_45020818/article/details/132652144

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_47670.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注