css中设置边框阴影效果

来源:互联网 发布:数字密码正则表达式js 编辑:程序博客网 时间:2024/05/19 23:18

在进行前端页面设计的时候,过于线条化的边框常常显得不太友好。为了解决这个问题,CSS中有专门设置边框阴影的属性box-shadow。


      支持box-shadow属性的浏览器:IE9+、Firefox 4、Chrome、Opera 以及 Safari 5.1.1。


     box-shadow的用法

       box-shadow: h-shadow v-shadow blur spread color inset;

这6个值分别是:left值 、top值、透明度、阴影外延宽度、颜色、向里凹陷(选填,默认为外延outset)。


代码示例:

<!DOCTYPE html><html><head><meta charset="utf-8" /><title></title><style> div{margin-top:100px;margin-left:100px;width:200px;height:200px;background-color:#C8E0C4; box-shadow:30px 10px 25px 10px #808080 inset;}</style></head><body><div></div></body></html>

效果图:

原创粉丝点击