css特效之炫酷的发光按钮

效果预览:效果预览
源码下载:关注公众号【RMRF】,回复【css7】可获取源码

一、HTML

<!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>按钮</title>
    <link rel="stylesheet" href="./css/index.css">
</head>
<body>
    <button>
        <span>Hellow World</span>
        <div class="top"></div>
        <div class="bottom"></div>
        <div class="left"></div>
        <div class="right"></div>
    </button>
</body>
</html>

二、CSS样式

body {
    display: flex;
    justify-content: center;
    background-color: #202020;
}

button {
    position: relative;
    margin-top: 300px;
    padding: 20px 60px;
    cursor: pointer;
    transition: 0.5s all;
    background-color: #202020;
}

button span {
    color: #646464;
    font-size: 20px;
}

button:hover {
    box-shadow: inset 0px 0px 25px #ff7700;
}

button:active {
    margin-top: 305px;
    transition: 0.2s all;
    box-shadow: inset 0px 0px 25px #ffaf6a;
}


button div {
    transition: 0.5s all;
    position: absolute;
    background-color: #ff7700;
    box-shadow: 0 0 15px #ff7700, 0 0 30px #ff7700, 0 0 50px #ff7700;
}

button .top {
    width: 15px;
    height: 2px;
    top: 0;
    left: 0;
}

button .bottom {
    width: 15px;
    height: 2px;
    bottom: 0;
    right: 0;
}

button .left {
    width: 2px;
    height: 15px;
    top: 0;
    left: 0;
}

button .right {
    width: 2px;
    height: 15px;
    right: 0;
    bottom: 0;
}

button:hover .top,
button:hover .bottom {
    width: 100%;
}

button:hover .left,
button:hover .right {
    height: 100%;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值