代码如下:

<!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></title>
<!--[if IE 6]>
<script type="text/javascript" src="https://files.cnblogs.com/wang4869/DD_belatedPNG.js" ></script>

<script type="text/javascript">
DD_belatedPNG.fix('.test');
</script>
<![endif]-->
<style type="text/css">
body
{
background-image: url(http://pic002.cnblogs.com/images/2012/364196/2012011115481415.jpg);
}
.test_outdiv
{
width: 200px;
height: 200px;
position: relative;
background-image:url(http://pic002.cnblogs.com/images/2012/364196/2012011115481415.jpg);
background-repeat:repeat;
}
.test
{
width: 200px;
height: 200px;
background-image: url(http://pic002.cnblogs.com/images/2012/364196/2012011115482423.png);
background-repeat: no-repeat;
position: absolute;
}
.div
{
width: 200px;
height: 200px;
background-color: Black;
filter: alpha(opacity=20);
moz-opacity: 0.2;
opacity: 0.2;
}
</style>
</head>
<body>
<div class="test_outdiv">
<div class="test">
</div>
</div>
<div class="div">
</div>
</body>
</html>

测试图片根据代码中的地址下载,一张jpg、一张png和一个JS

posted on 2012-01-11 16:04  william.cw.wang  阅读(905)  评论(0编辑  收藏  举报