A reference to the IE6 in the IMG icon can also reference PNG image JS plug-in code of the HTML is written in this way, compatible with IE6:
<a class= "btn btn-select" href= "javascript:fensong_addaccept ()" >
<span class=" Addtxt "> Add sending Units </ Span></a>
Attention:
1, in order to achieve display:inline-block; effect, in IE6 must add _zoom:1;_display:inline; So two properties to be compatible
2, line-height:16px; be sure to write, because the height of the icon is 16, but the parent element's Row height property affects the img tag in IE6, so the row height value is clearly defined, otherwise the icon is stretched
3, quoted the following transparent JS code to locate the IMG tag, you must write the style inside the line, otherwise invalid. Sweat, several pits, practice the truth Ah!
4. As long as the following JS code snippet is referenced in the page, the IMG tag can be arbitrarily written anywhere on the page.
JS Plugin code: You can make all the IMG tags in a project that reference PNG images fully transparent
function Correctpng ()
{
for (var i=0; i<document.images.length; i++)
{
var img = document.images[i]
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.cssText
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
i = I-1
}
}
}
Window.attachevent ("onload", correctpng);
Full code snippet to make PNG icon transparent in IE6