CSS完美實現圖片陰影製作效果

來源:互聯網
上載者:User
<title>無標題文檔</title>
<style type="text/css">
/*方法一:使用一個GIF檔案的方法*/
.gifshadow
{
padding:4px 10px 10px 4px;
border:0;
border-top:#eee 1px solid;
border-left:#eee 1px solid;
background-image: url(shadow.gif);/*換成你的圖片*/
background-repeat: no-repeat;
background-position: right bottom;
}
/*方法二:使用濾鏡*/
.cssshadow
{
-moz-box-shadow: 3px 3px 4px #000;
-webkit-box-shadow: 3px 3px 4px #000;
box-shadow: 3px 3px 4px #000;
/* For IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')";
/* For IE 5.5 - 7 */
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000');
}
/*方法三:使用2個PNG圖片,滑動門技術,可實現柔邊陰影*/
.pngshadow{
float:right;
background:url(right_buttom.png) no-repeat bottom right;
padding:0 10px 10px 0;

}
.pngshadow div{
background:url(left_top.png) no-repeat ;
}
.pngshadow img {
border:1px solid #FFFFFF;
padding:4px;
}
</style>
</head>
<body >
效果1:
<img class="gifshadow" src="1.jpg"/>

效果2:
<img class="cssshadow" src="1.jpg" />

效果3:
<div class="pngshadow">
<div><img src="1.jpg" /></div>
</div>
</body>
</html>


源碼資源檔下載:html.rar

http://www.rupeng.com/forum/viewthread.php?tid=14033&pid=101125&page=2&extra=#pid101125

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.