CSS给图片加边框

html-css08

CSS给图片加边框,第1张

分类: 电脑/网络 >>百度 >>百度空间

问题描述:

像pic.tuihu下面图片列表的边框效果.这个站的好像是DIV做的,请问用CSS怎么做.

解析:

<table

class="page_speeder_1677417789"

cellspacing=0 cellpadding=0 width=472 border=0>

<tbody>

<tr>

<td height=266

bgcolor=#ffffff

class="page_speeder_730337656"><a

href="tuihu/15584"

target=_blank><img height=88

src=精选美图_推虎tuihu_.files/2006101699160.gif

width=124

border=0></a></td>

</tr>

</tbody>

</table>

<style>

body,td,th { color:#666666}

body { background-color: #fffmargin-left: 6pxmargin-top: 6px}

.a1 { bottom:332pxright: 230pxborder: 1px solid #999999padding:4px}

.a1 img{

-moz-box-shadow: 3px 3px 4px #000

-webkit-box-shadow: 3px 3px 4px #000

box-shadow: 3px 3px 4px #000

/* For IE 8 */

-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')"

/* For IE 5.5 - 7 */

filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000000')

}

</style>

</head>

<body>

<div class="a1"><img src="images/logo.jpg" width="332" height="230"/></div>

</body>

bottom:332pxright: 230px 这段不知道你是派什么用处的,你并没有设置绝对定位的属性,那么bottom和right这两个用作定位的属性是无效的

可以加,比如之际在图片上直接写样式,如<img src="Bg.png" width="10" height="10" style="样式" />

或者在样式表里定义如

<div class="Bg"><img src="Bg.png" width="10" height="10" /></div>

.Bg img{样式}