JS Code:
<!--[if IE 6]>
<script src= "~/scripts/ui/dd_belatedpng.js" ></script>
<script>
$ (function () {
1, through the public class
Dd_belatedpng.fix (". Pngfix,.pngfix:hover");
2. Direct with selector: class name, ID, tag
Dd_belatedpng.fix (". imgpng,img");
});
</script>
<! [endif]-->
HTML code:
<div class= "contain" >
<div class= "Con" >
<p>
Window.onload = function () {
Dd_belatedpng.fix (". Pngfix,.pngfix:hover");
}
</p>
<div class= "Imgpng pngfix" ></div>
</div>
<div class= "Con" >
<H2>2, direct with selector: class name, ID, tag implementation <p>
Dd_belatedpng.fix (". imgpng,img");
</p>
<div class= "Imgpng" ></div>
</div>
</div>
CSS code:
<style>
. contain {width:1000px; height:300px; margin:0 auto; background: #fff;}
. contain con {width:400px; float:left;}
. contain h1 {font-size:18px; color: #333; margin-bottom:10px;}
. contain h2 {font-size:16px; color: #333;}
. imgpng {width:200px; height:150px; Background:url (/content/img/ie6.png);}
</style>
IE6 compatible Transparent Background map