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


  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值