css樣式實現給圖片添加陰影效果

css網頁樣式實現給圖片添加陰影效果

實現原理:定義漸變邊框來實現
詳細代碼:

  

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Language" content="zh-CN" />
    <title></title>
    <style type="text/css" >
    body {background:#2e334d;}
    img {border:none;}
    a.pic-shadow {display:inline-block;zoom:1;padding:1px;background:#262a3f;border:solid #2b3048 1px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;}
    a.pic-shadow img {padding:1px;background:#13151f;border:solid #1e2132 1px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;}
    </style>
    </head>
    <body>
    <a class="pic-shadow" href="#" title=""><img src="http://www.mianfeimoban.com/images/logo1.gif" alt="" title="" /></a>
    </body>
    </html>



    以下爲引用的內容:

    border-radius:5px;
    -moz-border-radius:5px;
    -webkit-border-radius:5px;

上面這段定義是各標準瀏覽器中圓角定義,

顏色代碼可以在ps中做好外發光效果後拾取。

我上面的效果是[柔和]、[擴展0]、[大小5px]、[顏色#000]其餘默認

當然了,特殊要求的話可以使用ie的濾鏡來實現更華麗的陰影,這裏就不多做介紹了!

本文來自:http://www.mianfeimoban.com/jianzhang_cyruanjian/cssjc/20120318/10837.html


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章