纯css实现三维卡片悬浮效果
代码语言:html
所属分类:悬停
代码描述:纯css实现三维卡片悬浮效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
@import url('https://fonts.googleapis.com/css?family=Raleway:200');
body {
font-family: 'Raleway', sans-serif;
background:#eee;
}
.wrapper {
position: absolute;
top: 10%;
left: 40%;
width: 300px;
height: 500px;
perspective: 900px;
}
.container {
position: absolute;
top: 0%;
width: 100%;
height: 100%;
transition: .5s all ease;
transform: rotateX(60deg) scale(0.7);
perspective: 900px;
box-shadow: 0px 20px 50px #555;
animation: entry 1s linear 1;
}
#c0 {
position: absolute;
top: 0%;
width: 100%;
height: 100%;
background: linear-gradient(to bottom, #eba65b 30%, #d99267 100%);
z-index: 300;
box-shadow: 0px 20px 100px #555;
}
#c1 {
background: linear-gradient(to bottom, #59476f 30%, #7b88d1 100%);
box-shadow: 0px 20px 100px #555;
left: 100%;
z-index: 0;
}
#c2 {
left: -100%;
z-index: 0;
background: linear-gradient(to bottom, #59476f 30%, #7b88d1 100%);
box-shadow: 0px 20px 100px #555;
}
.container:hover {
cursor: pointer;
transform: rotate(0deg) scale(1) translateY(10px);
transition: .5s all ease;
z-index: 400;
}
.image {
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 45%;
background: linear-gradient(to top, #eba65b 30%, #d99267 100%);
}
#i1 {
background: linear-gradient(to bottom, #59476f 30%, #7b88d1 100%);
}
#i2 {
background: linear-gradient(to bottom, #59476f 30%, #7b88d1 100%);
}
span {
position: absolute;
top: 0%;
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0