龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > div+css/html >

IE6下PNG背景透明

时间:2012-12-29 08:41来源:未知 作者:admin 点击:
分享到:
!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/html; charset=gb2312 / titleie6下png背

<!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/html; charset=gb2312" />
<title>ie6下png背景透明</title>
<style>
.bg{
 height:288px;
 width:512px;
 filter: progid:dximagetransform.microsoft.alphaimageloader(enabled=true, sizingmethod=scale, src="http://down.111cn.net/img/title.png" );
 background-repeat: repeat;
}
</style>
</head>

<body>
<div class="bg">fdsf</div>
</body>
</html>

语法:
filter : progid:dximagetransform.microsoft.alphaimageloader ( enabled=benabled , sizingmethod=ssize , src=surl )


如果是想使用png做背景透明的话,需要用到css教程滤镜和hack:

html>body .png { background:url(1.png); width:300px; height:100px; border:#000 solid 1px;}

/* ie6 */* html .png { filter: progid:dximagetransform.microsoft.alphaimageloader(enabled=true, sizingmethod=scale, src='1.png');
    background:none; width:300px; height:100px; border:#000 solid 1px;}

 


精彩图集

赞助商链接