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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.