First look at the effect chart
What we want is this effect.
The code is as follows: |
Copy code |
. Box-163css {width: 600px; margin: 20px auto ;} /* Blogpart2 */ . Blogpart2 {width: 570px; text-align: left; padding-bottom: 15px; overflow: hidden; float: left; margin-bottom: 24px; background: url (.. /images/line02.gif) repeat-x left bottom; border: 1px solid #000; padding: 10px 0 10px 20px; background: # eee ;} . Kg01 {width: 68px; position: relative; height: 68px; float: left; display: inline ;} . Kg01. png {position: absolute; z-index: 1000 ;} . Kg01 img {width: 68px; height: 68px ;} |
Html code
The code is as follows: |
Copy code |
<Body> <Div class = "blogpart2"> <Div class = "maid">
<A href = "/js06.html"> </a> </Div> </Div> <Div class = "blogpart2"> <Div class = "maid">
<A href = "/js06.html"> </a> </Div> </Div> <Div class = "blogpart2"> <Div class = "maid">
<A href = "/js06.html"> </a> </Div> </Div> </Body> </Html> |
Png. js code
The code is as follows: |
Copy code |
// JavaScript Document Function correctPNG () // correctly handle PNG transparency in Win IE 5.5 & 6. { Var arVersion = navigator. appVersion. split ("MSIE ") Var version = parseFloat (arVersion [1]) If (version> = 5.5) & (document. body. filters )) { For (var j = 0; j <document. images. length; j ++) { Var img = document. images [j] Var imgName = img. src. toUpperCase () If (imgName. substring (imgName. length-3, imgName. length) = "PNG ") { Var imgID = (img. id )? "Id = '" + img. id + "'":"" Var imgClass = (img. className )? "Class = '" + img. className + "'":"" Var imgTitle = (img. title )? "Title = '" + img. title + "'": "title = '" + img. alt + "'" Var imgStyle = "display: inline-block;" + img.style.css Text If (img. align = "left") imgStyle = "float: left;" + imgStyle If (img. align = "right") imgStyle = "float: right;" + imgStyle If (img. parentElement. href) imgStyle = "cursor: hand;" + imgStyle Var strNewHTML = "<span" + imgID + imgClass + imgTitle + "Style =" "+" width: "+ img. width +" px; height: "+ img. height +" px; "+ imgStyle + ";" + "Filter: progid: DXImageTransform. Microsoft. AlphaImageLoader" + "(Src = '" + img. src + "', sizingMethod = 'scale');"> </span>" Img. outerHTML = strNewHTML J = J-1 } } } } Window. attachEvent ("onload", correctPNG ); |