css炫酷的按钮

8 篇文章 0 订阅

css炫酷的按钮

效果一

在这里插入图片描述

    <style>
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            background: #000;
            min-height: 100vh;
        }
        
        a {
            position: relative;
            padding: 10px 30px;
            margin: 0 45px;
            color: #21ebff;
            text-decoration: none;
            font-size: 20px;
            text-transform: uppercase;
            transition: 0.5s;
            overflow: hidden;
            -webkit-box-reflect: below 1px linear-gradient(transparent, #0003);
        }
        
        a:hover {
            background: #21ebff;
            color: #111;
            box-shadow: 0 0 50px #21ebff;
            transition-delay: 0.5s;
        }
        
        a::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 10px;
            height: 10px;
            border-top: 2px solid #21ebff;
            border-left: 2px solid #21ebff;
            transition: 0.5s;
            transition-delay: 0.5s;
        }
        
        a:hover::before {
            width: 100%;
            height: 100%;
            transition-delay: 0s;
        }
        
        a::after {
            content: '';
            position: absolute;
            right: 0;
            bottom: 0;
            width: 10px;
            height: 10px;
            border-bottom: 2px solid #21ebff;
            border-right: 2px solid #21ebff;
            transition: 0.5s;
            transition-delay: 0.5s;
        }
        
        a:hover::after {
            width: 100%;
            height: 100%;
            transition-delay: 0s;
        }
        /* 自定义 */
        
        button {
            position: relative;
            padding: 10px 30px;
            margin: 0 45px;
            color: #21ebff;
            text-decoration: none;
            font-size: 20px;
            text-transform: uppercase;
            transition: 0.5s;
            overflow: hidden;
            -webkit-box-reflect: below 1px linear-gradient(transparent, #0003);
            color: #111;
            box-shadow: 0 0 50px #21ebff;
            transition-delay: 0.5s;
            border-radius: 50%;
        }
        
        .text {
            position: relative;
            padding: 10px 30px;
            margin: 0 45px;
            color: #21ebff;
            text-decoration: none;
            font-size: 20px;
            text-transform: uppercase;
            transition: 0.5s;
            overflow: hidden;
            -webkit-box-reflect: below 1px linear-gradient(transparent, #0003);
            box-shadow: 0 0 50px #21ebff;
            transition-delay: 0.5s;
            border-radius: 50%;
        }
    </style>
    
	<body>
	    <a href="#">Button</a>
	    <button> fdfdf</button>
	    <div class="text"> dfsdfsdf </div>
	</body>

效果二

在这里插入图片描述

<style>
 @keyframes run {
            from {
                transform: rotate(0deg);
            }
            /*50%{
                    transform: rotate(180deg);
                }*/
            to {
                transform: rotate(360deg);
            }
        }
        
        @keyframes daorun {
            from {
                transform: rotate(360deg);
            }
            /*50%{
                    transform: rotate(180deg);
                }*/
            to {
                transform: rotate(0deg);
            }
        }
        
        .sleepContentView {
            width: 242px;
            height: 242px;
            background-image: linear-gradient(#0cec17, rgb(12, 67, 219));
            border-radius: 50%;
            text-align: center;
            padding: 20px;
            font-size: 28px;
            box-sizing: border-box;
            animation: run 2.5s linear infinite;
            box-shadow: 0 0 50px #707070;
            /* -webkit-box-reflect: below 1px linear-gradient(transparent, #0003); */
        }
        
        .sleepContentView .circle {
            width: 100%;
            height: 100%;
            background: #fff;
            border-radius: 50%;
        }
        
        .contenttext {
            position: absolute;
            z-index: 99px;
            width: 190px;
            top: 100px;
            animation: daorun 2.5s linear infinite;
        }
 </style>

<body>
  <div class="sleepContentView">
        <div class="circle">
            <div class="contenttext">
                Button
            </div>

        </div>
    </div>
</body>

效果三

在这里插入图片描述


<style>
    .button-3d-2 {
        position: relative;
        background: #ecd300;
        background-image: linear-gradient(to right, rgb(248, 66, 20), transparent);
        /* background: radial-gradient(hsl(54, 100%, 50%), hsl(54, 100%, 40%)); */
        font-size: 1.4rem;
        text-shadow: 0 -1px 0 #c3af07;
        color: white;
        border: 1px solid hsl(54, 100%, 20%);
        border-radius: 100%;
        height: 120px;
        width: 120px;
        z-index: 4;
        outline: none;
        box-shadow: inset 0 1px 0 hsl(54, 100%, 50%), 0 2px 0 hsl(54, 100%, 20%), 0 3px 0 hsl(54, 100%, 18%), 0 4px 0 hsl(54, 100%, 16%), 0 5px 0 hsl(54, 100%, 14%), 0 6px 0 hsl(54, 100%, 12%), 0 7px 0 hsl(54, 100%, 10%), 0 8px 0 hsl(54, 100%, 8%), 0 9px 0 hsl(54, 100%, 6%);
    }
    
    .button-3d-2:active {
        margin-top: 2px;
        box-shadow: inset 0 1px 0 hsl(54, 100%, 50%), 0 2px 0 hsl(54, 100%, 16%), 0 3px 0 hsl(54, 100%, 14%), 0 4px 0 hsl(54, 100%, 12%), 0 5px 0 hsl(54, 100%, 10%), 0 6px 0 hsl(54, 100%, 8%), 0 7px 0 hsl(54, 100%, 6%);
    }
</style>

<body>
    <button class="button-3d-2">Circle!</button>

</body>

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值