div+css实现十一种按钮悬浮背景动画效果代码
代码语言:html
所属分类:布局界面
代码描述:div+css实现十一种按钮悬浮背景动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css2?family=Lato&display=swap" rel="stylesheet">
<style>
body {
background: #e0e5ec;
}
h1 {
position: relative;
text-align: center;
font-weight: 700;
letter-spacing: 5px;
margin-bottom: 20px;
}
* {
padding: 0;
margin: 0;
font-family: "Cormorant Garamond", serif;
box-sizing: border-box;
}
p {
font-family: 'Lato', sans-serif;
font-weight: 300;
text-align: center;
font-size: 18px;
color: #676767;
position: relative;
}
.frame {
width: 90%;
margin: 40px auto;
text-align: center;
}
button {
margin: 20px;
position: relative ;
}
.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 {
width: 130px;
height: 40px;
line-height: 42px;
padding: 0;
border: none;
background: rgb(255,27,0);
background: linear-gradient(110deg, rgba(0, 255, 255) 0%, rgba(0,0,255) 100%);
}
.btn-1:hover {
color: #5e90e9;
background: transparent;
box-shadow:none;
}
.btn-1:before,
.btn-1:after{
content:'';
position:absolute;
top: 0;
right:0;
height:2px;
width:0;
background: linear-gradient(320deg, #0000ff 0%, #00bfff 70%, #00ffff 30%);
box-shadow:
-1px -1px 5px 0px #fff,
7px 7px 20px 0px #0003,
4px 4px 5px 0px #0002;
transition:400ms ease all;
}
.btn-1:after{
right:inherit;
top: 40px;
left:0;
bottom:0;
}
.btn-1:hover:before,
.btn-1:hover:after{
width:100%;
transition:800ms ease all;
}
/* 2 */
.btn-2 {
background:.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0