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="box">
<ul>
<li>
<img src="img/1.jpg"/>
</li>
<li>
<img src="img/2.jpg"/>
</li>
<li>
<img src="img/3.jpg"/>
</li>
</ul>
</div>
</body>
</html>
CSS代码:
.box{
980px;
height: auto;
clear: both;
overflow: hidden;
margin: 20px auto;
}
.box li{
300px;
height: auto;
float: left;
margin: 20px,10px;
background: #FFFFFF;
border: 2px solid #efefef;
position: relative;
box-shadow: 0 1px 4px rgba(0,0,0,0.3),0 0 60px rgba(0,0,0,0.1) inset;
-webkit-box-shadow: 0 1px 4px rgba(0,0,0,0.3),0 0 60px rgba(0,0,0,0.1) inset;
-moz-box-shadow: 0 1px 4px rgba(0,0,0,0.3),0 0 60px rgba(0,0,0,0.1) inset;
-o-box-shadow: 0 1px 4px rgba(0,0,0,0.3),0 0 60px rgba(0,0,0,0.1) inset;
}
.box li img{
display: block;
290px;
height: 200px;
margin: 5px;
}
.box li:after{
content:' ' ;
position: absolute;
90%;
height: 80%;
left : 20px;
bottom: 8px;
background: transparent;
z-index: -1;
box-shadow:0 8px 20px rgba(0,0,0,0.6) ;
-webkit-box-shadow:0 8px 20px rgba(0,0,0,0.6) ;
-moz-box-shadow:0 8px 20px rgba(0,0,0,0.6) ;
-o-box-shadow:0 8px 20px rgba(0,0,0,0.6) ;
-webkit-transform: skew(-12deg) rotate(-4deg);
-moz-transform: skew(-12deg) rotate(-4deg);
-o-transform: skew(-12deg) rotate(-4deg);
-ms-transform: skew(-12deg) rotate(-4deg);
}
.box li:before{
content:' ' ;
position: absolute;
90%;
height: 80%;
right : 20px;
bottom: 8px;
background: transparent;
z-index: -1;
box-shadow:0 8px 20px rgba(0,0,0,0.6) ;
-webkit-box-shadow:0 8px 20px rgba(0,0,0,0.6) ;
-moz-box-shadow:0 8px 20px rgba(0,0,0,0.6) ;
-o-box-shadow:0 8px 20px rgba(0,0,0,0.6) ;
-webkit-transform: skew(12deg) rotate(4deg);
-moz-transform: skew(12deg) rotate(4deg);
-o-transform: skew(12deg) rotate(4deg);
-ms-transform: skew(12deg) rotate(4deg);
}