css加载动画

css加载动画_第1张图片

DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Documenttitle>
    <style>
        body{
            background: #000;
        }

        .outer,
        .middle,
        .inner {
            border: 3px solid transparent;
            border-top: 3px solid #3cefff;
            border-right: 3px solid #3cefff;
            border-radius: 50%;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            /* box-shadow: 0px 0px 18px #3cefff; */
        }

        .outer {
            width: 48px;
            height: 48px;
            animation: action 2s linear infinite;
        }

        .middle {
            width: 32px;
            height: 32px;
            /* reverse 动画反向播放 */
            animation: action 1.75s linear reverse infinite;
        }

        .inner {
            width: 16px;
            height: 16px;
            animation: action 1.5s linear infinite;
        }

        @keyframes action {
            to {
                transform: translate(-50%, -50%) rotate(360deg);
            }
        }
    style>
head>

<body>
    <div class="loader">
        <div class="outer">div>
        <div class="middle">div>
        <div class="inner">div>
    div>
body>

html>

你可能感兴趣的:(css,前端,javascript)