效果图:

完整代码:
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <title>旋转方块加载动画</title>
    <style type="text/css">
        body {
            background: #ECF0F1;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }
        .spinner {
            width: 40px;
            height: 40px;
            background-color: #3498db;
            animation: spin 1s infinite linear;
        }
        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }
            100% {
                transform: rotate(360deg);
            }
        }
    </style&
                


















