你的位置:首页 > 网页设计

[网页设计]CSS3 transform实现图片投影效果


<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>图片投影效果</title>
<style>
.box {
position: absolute;
padding: 2px;
background: white;
-webkit-box-shadow: 1px 2px 4px rgba(0,0,0,.5);
-moz-box-shadow: 1px 2px 4px rgba(0,0,0,.5);
box-shadow: 1px 2px 4px rgba(0,0,0,.5);
}
.box img {
display:block;
width:200px;
height:220px;
border: 1px inset #8a4419;
background:#eee;
}
.box:after {
content: '';
-webkit-box-shadow: 100px 0 10px rgba(0,0,0,.2);
-moz-box-shadow: 100px 0 10px rgba(0,0,0,.2);
box-shadow: 100px 0 10px rgba(0,0,0,.2);
position: absolute;
width: 50%;
height: 80px;
bottom: 0;
right: 65px;
z-index: -1;
-webkit-transform: skew(-40deg);
-moz-transform: skew(-40deg);
-o-transform: skew(-40deg);
transform: skew(-40deg);
}
</style>
</head>
<body>
<div>http://www.999jiujiu.com/</div>
<div ><img src='wall_s9.jpg'/></div>
</body>
</html>