运行图
代码
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
.button {
margin: 200px;
width: 400px;
height: 200px;
background-color: #ccf;
text-align: center;
line-height: 180px;
border-radius: 50%;
box-shadow: 0px -15px 15px #88f inset,10px -15px 15px #44f inset,10px -15px 15px #fff inset, 0px 15px #88f,-35px 40px 5px rgba(0,0,0,0.4);
overflow: hidden;
transition: all 0.3s ease-in;
}
.button:hover{
margin-top: 250px;
box-shadow: 0px -15px 15px #88f inset,10px -15px 15px #44f inset,10px -15px 15px #fff inset, 0px 3px #88f,-15px 15px 5px rgba(0,0,0,0.4);
}
.content {
color: #7779ff;
font-size: 60px;
text-shadow: -3px 3px 1px white,3px -3px 1px #44f;
transform: scale(1,0.8);
}
</style>
</head>
<body>
<div class="button">
<div class="content">3d按钮</div>
</div>
</body>
</html>
笔记 一个盒子可以添加多个阴影,通过多个阴影,内外阴影和动画过渡,实现3d的按钮
|