CSS网页制作网页图片字周围的白边怎么弄啊?

html-css05

CSS网页制作网页图片字周围的白边怎么弄啊?,第1张

最简单的方式是直接给图片加个白色的边框:

<img src="images/123.jpg" style="border:3px solid #fff" />

想好看点的话在白边外再套一个模拟阴影的边框,这样更真实:

<div style="float:leftborder:1px solid border-color:#d0d0d0 #aaa #aaa #d0d0d0">

    <img src="images/123.jpg" style="display:blockborder:3px solid #fff" />

</div>

下面列出css的几个hack,参考一下吧 IE都能识别*,标准浏览器(如FF)不能识别*;

IE6能识别*,但不能识别 !important;

IE7能识别*,也能识别 !important;

IE8能识别\0,不能识别*,+,_,*加!important

FF不能识别*,但能识别 !important;

例如style="*width:10px!importantwidth:20px"

这样在IE6下宽度为10px,在IE7下宽度时20px

表格外发光:<table border="0" style="filter:glow(color=green,strength=16)width:234height:99border:1 dotted red"><tr><td> </td></tr></table>

字体外发光:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312" />

<title>无标题文档</title>

<style type="text/css">

body {

font:14px "Verdana"

background-color:#3366cc

}

.sizscolor {

position:absolute

padding:4px

filter:

Dropshadow(offx=1,offy=0,color=white)

Dropshadow(offx=0,offy=1,color=white)

Dropshadow(offx=0,offy=-1,color=white)

Dropshadow(offx=-1,offy=0,color=white)

}

</style>

</head>

<body>

<br>

<div class="sizscolor ">政策法规</div>

</body>

</html>