CSS给图片加边框

html-css015

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>

思路是1、做上中下三个层;在htm文件里写2、在css文件里写:#1 { background:url(img/1.jpg) no-repeatwidth:500pxheight:2px} “这里是指宽500像素、高2px的图片1.jpg做层背景,显示成上边框,你也可以做高一点”#2 { background:url(img/2.jpg) repeat-ywidth:500px} "这里是指宽500像素、不定高的层,背景图片2.jpg沿y轴方向平铺"#3 同理#13、还要注意ie6、ie7、ie8、火狐浏览器等等的兼容性问题。