×

CSS3实现加载中(loading)等待按钮状态

作者:jiang2019.03.06来源:Web前端之家浏览:34507评论:0
关键词:css3loading

试着用CSS3实现加载中(loading)等待按钮状态,一起来看下源码,学习哦。

<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        button {
            opacity: 0.5;
            cursor: default;
            pointer-events: none;
        }

        button:before {
            content: '';
            display: inline-block;
            width: 1em;
            height: 1em;
            margin-right: 0.5em;
            color: red;
            border: 1px solid red;
            border-radius: 50%;
            vertical-align: -10%;
            clip-path: polygon(0% 0%, 100% 0%, 100% 30%, 0% 30%);
            animation: rotate 1s linear infinite;
        }

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

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

<body>
    <button>css-loading</button>
</body>

</html>

您的支持是我们创作的动力!
温馨提示:本文作者系 ,经Web前端之家编辑修改或补充,转载请注明出处和本文链接:
https://jiangweishan.com/article/css2934-9234-92349329.html

网友评论文明上网理性发言 已有0人参与

发表评论: