清风细雨楼 Design By www.eepep.com
两种实现方法一种是利用内外层的div边框来实例层次感觉的css边框阴影效果,另一种是利用了背景图片再加内外div来实现的这种效果更漂亮。
简单一点的纯css

复制代码代码如下:
<head>
<metahttp-equiv="content-type"content="text/html;charset=gb2312"/>
<title>cssdiv边框阴影</title>
<styletype="text/css">
body{padding:200px;}
div{border-width:1px;border-style:solid;padding:1px;}
.a{background-color:#f3f3f3;border-color:#fbfbfb;}
.b{background-color:#d8d8d8;border-color:#e8e8e8;}
.c{background-color:#fff;border-color:#bbb;height:100px;color:#ff0000;}
</style>
</head>
<body>
<divclass="a">
<divclass="b">
<divclass="c">边框为阴影效果</div>
</div>
</div>
</body>
</html>

复杂一点的利用图片背景

复制代码代码如下:
<!doctypehtmlpublic"-//w3c//dtdxhtml1.0transitional//en""http://www.027eat.com/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<htmlxmlns="http://www.027eat.com/1999/xhtml">
<head>
<title>css边框阴影</title>
<style>
.drops教程hadow2{
float:left;
clear:left;
background:url(http://www.6a8a.com/uploadfile/2011/0621/20110621015322996.png)no-repeatbottomright!important;
background:url(http://www.6a8a.com/uploadfile/2011/0621/20110621015329456.gif)no-repeatbottomright;
margin:10px010px10px!important;
margin:10px010px5px;
width:500px;
padding:0px;
}
.innerbox{
position:relative;
bottom:6px;
right:6px;
border:1pxsolid#999999;
padding:4px;
margin:0px0px0px0px;
}
.innerbox{
margin:0px0px-3px0px;
margin:0px0px0px0px;
}
.innerboxp{
font-size:14px;
margin:3px;
}
</style>
</head>
<body>
<divclass="dropshadow2"><divclass="innerbox"><h4>css阴影:</h4><p>这段边框阴影效果怎么样呢?</p></div></div>
</body>
</html>
清风细雨楼 Design By www.eepep.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
清风细雨楼 Design By www.eepep.com