推荐两个简洁的鼠标悬停渐变按钮

悬停后的效果就不展示了,感兴趣的话自己去试试吧

    <button class="custom-btn btn-1"><span> 搜索 </span></button>
    <button class="custom-btn btn-2"><span> 搜索 </span></button>

CSS部分是我最喜欢的紫薇花色,不喜欢可以调试下

/* 渐变按钮 */
.custom-btn
{
width: 130px;
height: 40px;
color: #fff;
border-radius: 5px;
padding: 10px 25px;
font-family: 'Lato', sans-serif;
font-weight: 500;
background: transparent;
cursor: pointer;
transition: all 0.3s ease;
position: relative;
display: inline-block;
box-shadow:inset 2px 2px 2px 0px rgba(255,255,255,.5),
7px 7px 20px 0px rgba(0,0,0,.1),
4px 4px 5px 0px rgba(0,0,0,.1);
outline: none;
}
/* 1 */
.btn-1
{
background: rgb(247,150,192);
background: radial-gradient(circle, rgba(247,150,192,1) 0%, rgba(118,174,241,1) 100%);
line-height: 42px;
padding: 0;
border: none;
}
.btn-1 span
{
position: relative;
display: block;
width: 100%;
height: 100%;
}
.btn-1:before,
.btn-1:after
{
position: absolute;
content: "";
height: 0%;
width: 1px;
box-shadow:
-1px -1px 20px 0px rgba(255,255,255,1),
-4px -4px 5px 0px rgba(255,255,255,1),
7px 7px 20px 0px rgba(0,0,0,.4),
4px 4px 5px 0px rgba(0,0,0,.3);
}
.btn-1:before
{
right: 0;
top: 0;
transition: all 500ms ease;
}
.btn-1:after
{
left: 0;
bottom: 0;
transition: all 500ms ease;
}
.btn-1:hover
{
color: #76aef1;
background: transparent;
box-shadow: none;
}
.btn-1:hover:before
{
transition: all 500ms ease;
height: 100%;
}
.btn-1:hover:after
{
transition: all 500ms ease;
height: 100%;
}
.btn-1 span:before,
.btn-1 span:after
{
position: absolute;
content: "";
box-shadow:
-1px -1px 20px 0px rgba(255,255,255,1),
-4px -4px 5px 0px rgba(255,255,255,1),
7px 7px 20px 0px rgba(0,0,0,.4),
4px 4px 5px 0px rgba(0,0,0,.3);
}
.btn-1 span:before
{
left: 0;
top: 0;
width: 0%;
height: .5px;
transition: all 500ms ease;
}
.btn-1 span:after
{
right: 0;
bottom: 0;
width: 0%;
height: .5px;
transition: all 500ms ease;
}
.btn-1 span:hover:before
{
width: 100%;
}
.btn-1 span:hover:after
{
width: 100%;
}
/* 2 */
.btn-2
{
background-color: #f0ecfc;
background-image: linear-gradient(315deg, #f0ecfc 0%, #c797eb 74%);
line-height: 42px;
padding: 0;
border: none;
}
.btn-2 span
{
position: relative;
display: block;
width: 100%;
height: 100%;
}
.btn-2:before,
.btn-2:after
{
position: absolute;
content: "";
right: 0;
bottom: 0;
background: #c797eb;
transition: all 0.3s ease;
}
.btn-2:before
{
height: 0%;
width: 2px;
}
.btn-2:after
{
width: 0%;
height: 2px;
}
.btn-2:hover:before
{
height: 100%;
}
.btn-2:hover:after
{
width: 100%;
}
.btn-2:hover
{
background: transparent;
}
.btn-2 span:hover
{
color: #c797eb;
}
.btn-2 span:before,
.btn-2 span:after
{
position: absolute;
content: "";
left: 0;
top: 0;
background: #c797eb;
transition: all 0.3s ease;
}
.btn-2 span:before
{
width: 2px;
height: 0%;
}
.btn-2 span:after
{
height: 2px;
width: 0%;
}
.btn-2 span:hover:before
{
height: 100%;
}
.btn-2 span:hover:after
{
width: 100%;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值