1.曲边阴影
《HTML代码》
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>css3实现曲线阴影和翘边阴影</title>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
</head>
<body>
<div class="wrap effect">
<h1>Shadow Effect</h1>
</div>
</body>
</html>
《CSS代码》
body{
font-family: arial;
font-size: 20px;
}
body,ul{
margin: 0;
padding: 0;
list-style: none;
}
.wrap{
70%;
height: 200px;
margin: 50px auto;
background: #fff;
}
.wrap h1{
font-size: 20px;
text-align: center;
line-height: 200px;
}
.effect{
position: relative;
box-shadow:0px 10px 4px rgba(0,0,0,0.3), 0px 0px 40px rgba(0,0,0,0.1) inset;
-webkit-box-shadow: 0px 1px 4px rgba(0,0,0,0.3),0px 0px 40px rgba(0,0,0,0.1) inset;
-moz-box-shadow:0px 1px 4px rgba(0,0,0,0.3);
-o-box-shadow:0px 1px 4px rgba(0,0,0,0.3);
}
.effect:after,.effect:before{
content: ' ';
position: absolute;
background: #f00;
z-index: -1;
top: 50%;
bottom:0;
left: 20px;
right: 20px;
box-shadow: 0 0 10px rgba(0,0,0,0.8);
-webkit-box-shadow: 0 0 10px rgba(0,0,0,0.8);
-moz-box-shadow:0 0 10px rgba(0,0,0,0.8);
-o-box-shadow:0 0 10px rgba(0,0,0,0.8);
border-radius:100px/10px ;
}