css+div页面两侧的阴影怎样实现的

html-css06

css+div页面两侧的阴影怎样实现的,第1张

border: 1px solid #696padding: 60px 0text-align: centerwidth: 200px

-webkit-border-radius: 8px

-moz-border-radius: 8px

border-radius: 8px

-webkit-box-shadow: #666 0px 0px 10px

-moz-box-shadow: #666 0px 0px 10px

box-shadow: #666 0px 0px 10pxbackground: #EEFF99behavior: url(/PIE.htc)

这是使用纯CSS实现的效果,在DIV层的区域边框添加阴影效果,看上去非常形象,但是实现起来并不是太难,CSS代码比较简洁,值得我们学习。

<title>盒子阴影的CSS实现方法</title>

<style>

.baseBlock{

width:220px

position:relative

}

.baseBlockIn{

padding:10px 15px

background:#a0b3d6

box-shadow:10px 10px 5px #444

-moz-box-shadow:10px 10px 5px #444

-webkit-box-shadow:10px 10px 5px #444

position:relative

z-index:1

}

.ieShadow{

_width:215px

_height:160px

filter:progid:DXImageTransform.Microsoft.Blur(pixelradius=6)

-ms-filter:"progid:DXImageTransform.Microsoft.Blur(pixelradius=6)"

background-color:#444\9

position:absolute

left:5px

top:5px

right:-5px

bottom:-5px

}

</style>

<div class="baseBlock">

<div class="baseBlockIn">

可以用CSS3的阴影属性。 不过要支持IE6的话,加载个 .htc 行为文件就好了。

border: 1px solid #696padding: 60px 0text-align: centerwidth: 200px

-webkit-box-shadow: #666 0px 0px 10px

-moz-box-shadow: #666 0px 0px 10px

box-shadow: #666 0px 0px 10pxbackground: #EEFF99behavior: url(/PIE.htc)