当圆角且阴影的图片时,你该怎么做?

8 篇文章 0 订阅

PSD设计图


    当遇到圆角并且有阴影的图片时,你是怎么处理的?
    我们在切图时,避免不了会有圆角加阴影的图片,一般为了省时间嫌麻烦,就直接把整张图片(图片+圆角+阴影)切下来,以img的形式放上去。
    但如果是动态更改图片时,上面的做法使得编辑人员以后得每张图片都要处理成圆角+阴影效果。这样为了一时的方便,使以后的工作更加复杂,何不刚开始就考虑清楚,做个适应动态更新图片的样式呢?

 



具体做法:
把阴影跟圆角作为背景,用定位和并列的方法,通过层次来解决这个问题。

素材:
背景图片



图    片


部分css:
.roundPic{width:350px; margin:50px auto;}
.roundPic ul{ list-style:none; overflow:hidden;}
.roundPic ul li{ width:105px; height:135px; overflow:hidden; margin:0px 5px; float:left; position:relative;}
.roundPic ul li .imgLink{ position:relative; display:block; width:98px; height:99px; padding:1px 6px 7px 1px; background:url(bg3.png) no-repeat;z-index:1px; text-indent:-1000px;}
.roundPic ul li img{ position:absolute; z-index:0; top:1px; left:1px;}
.roundPic ul li h3{ height:20px; line-height:20px; text-align:center; color:#f00; margin-top:4px;}
部分html:
<div class="roundPic">
    <ul>
        <li>
            <img src="lb.jpg" width="98" height="99" />
            <a href="#" class="imgLink" hidefocus="" title="某某某">某某某</a>
            <h3><a href="#">标题:某某某</a></h3>
        </li>
        <li>
            <img src="lb.jpg" width="98" height="99" />
            <a href="#" class="imgLink" hidefocus="" title="某某某">某某某</a>
            <h3><a href="#">标题:某某某</a></h3>
        </li>
        <li>
            <img src="lb.jpg" width="98" height="99" />
            <a href="#" class="imgLink" hidefocus="" title="某某某">某某某</a>
            <h3><a href="#">标题:某某某</a></h3>
        </li>
    </ul>
</div>

这里只是贴了部分代码,对于css reset 没有贴上

最后效果:



已测试兼容:IE6+、FF、Chrome、Safari、Opera主流浏览器

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值