• 两种风格的纯CSS3加载动画


    DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>加载动画title>
        <style>
          .loader {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            border: 4px solid #f3f3f3;
            border-top: 4px solid #3498db;
            animation: spin 1s linear infinite;
            margin: 0 auto;
          }
    
          @keyframes spin {
            0% {
              transform: rotate(0deg);
            }
            100% {
              transform: rotate(360deg);
            }
          }
          .spin {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            margin: 50px;
            width: 200px;
            height: 200px;
            border: 1px solid #999;
          }
          .spin span {
            margin-top: 5px;
          }
          .container {
            display: flex;
          }
    
          .dots {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 200px;
            height: 200px;
            margin: 50px;
            border: 1px solid #999;
          }
          
         
          .dot {
            width: 10px;
            height: 10px;
            background-color: #ccc;
            border-radius: 50%;
            margin: 0 3px;
            opacity: 0.4;
            animation: loading 1.2s infinite;
          }
    
          .dot:nth-child(1) {
            animation-delay: 0.1s;
          }
    
          .dot:nth-child(2) {
            animation-delay: 0.3s;
          }
    
          .dot:nth-child(3) {
            animation-delay: 0.5s;
          }
    
          @keyframes loading {
            0% {
              transform: scale(1);
              opacity: 0.4;
            }
            50% {
              opacity: 1;
              transform: scale(1.2);
            }
            100% {
              opacity: 0.4;
              transform: scale(1);
            }
          }
        style>
      head>
      <body>
        <div class="container">
          
          <div class="spin">
            <div class="loader">div>
            <span>加载中...span>
          div>
    
          
          <div class="dots">
            <span class="dot">span>
            <span class="dot">span>
            <span class="dot">span>
          div>
        div>
      body>
    html>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108

    页面效果
    在这里插入图片描述

  • 相关阅读:
    [附源码]计算机毕业设计基于springboot的高校资源共享平台
    看看阿里文娱怎么建设开放平台,这就是专业~
    码蹄集 - MT2065 - 整数大小比较
    Vue3 学习-组件通讯(二)
    修改 MySQL 最大连接数
    85-maven工程servlet实例
    css 样式实战
    面试中常聊 AMS,你是否又真的了解?
    git远程协作
    ElementUI之登陆+注册
  • 原文地址:https://blog.csdn.net/m0_46219714/article/details/133082009