按钮模版:btn-7

效果展示

实现思路

这个按钮也是线性渐变的,当鼠标悬浮时,背景色会从中间位置慢慢向左偏移

实现代码

1
<button class="btn-7">BTN-7</button>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
.btn-7 {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 12px 24px;
border-radius: 25px;
background-image: linear-gradient(45deg, #ff0099, #00f1ff);
background-size: 200%;
color: #fff;
transition: all 0.4s ease-in-out;
border: none;
cursor: pointer;
}
.btn-7:hover {
background-position: right center;
}