css5+html5动画,网页加载页面

这篇博客展示了如何利用HTML和CSS创建一个富有视觉吸引力的加载效果。通过CSS的关键帧动画,实现了元素的旋转动画,创建了从顶部渐变颜色的背景以及中心的加载文字动画,整体效果呈现为一个圆形的加载指示器,动态显示‘拼命加载中’的文本。
摘要由CSDN通过智能技术生成

网页效果

加载浏览器

 

代码段(少量注释)

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            /* 100窗口高度 */
            height: 100vh;
            background: linear-gradient(to bottom, #2b6876, #09203f);
            /* 弹性盒子 水平 居中 */
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .loading {
            position: relative;
            width: 200px;
            height: 200px;
            /* background-color: pink; */
            /* background-color: pink; */
            border-top: 10px solid #63a69f;
            border-radius: 50%;
            /* text-align: center;
            line-height: 200px; */
            /* 动画1 */
            animation: move1 2s linear infinite;

        }

        .loading::before,
        .loading::after {
            content: "";
            position: absolute;
            /* 向上-10px */
            top: -10px;
            left: 0;
            width: 200px;
            height: 200px;
            /* background-color: #fff; */
            border-radius: 50%;
        }

        .loading::before {
            border-top: 10px solid #dfdf0e;
            transform: rotate(120deg);

        }

        .loading::after {

            border-top: 10px solid #eaa613;
            transform: rotate(240deg);
        }

        .loading span {
            position: absolute;
            width: 200px;
            height: 200px;
            /* background-color: pink; */
            color: #fff;
            text-align: center;
            line-height: 200px;
            /* 动画2 */
            animation: move2 2s linear infinite;
        }

        /* 关键帧 */
        @keyframes move1 {
            from {
                transform: rotate(0);
            }

            to {
                transform: rotate(360deg);
            }
        }

        @keyframes move2 {
            from {
                transform: rotate(0);
            }

            to {
                transform: rotate(-360deg);
            }
        }
    </style>
</head>

<body>
    <div class="loading">
        <span>拼命加载中</span>
    </div>
</body>

</html>

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Bubble_Qi

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值