Two ways to make IE6 display PNG-24 format images normally

Two ways to make IE6 display PNG-24 format images normally
Method 1:
Please add the following code after </html>

Copy code
The code is as follows:

<!--[if IE 6]>
<script type="text/javascript">
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
}
}
}
correctPNG();
</script>
<![endif]-->

Method 2:

Copy code
The code is as follows:

<!--[if IE 6]>
<script src="js/DD_belatedPNG_0.0.8a.js" type="text/javascript"></script>
<script type="text/javascript">
DD_belatedPNG.fix('*');
</script>
<![endif]-->

<<:  Linux super detailed gcc upgrade process

>>:  HTML Nine-grid Layout Implementation Method

Recommend

Vue implements internationalization of web page language switching

1. Basic steps 1: Install yarn add vue-i18n Creat...

React+ts realizes secondary linkage effect

This article shares the specific code of React+ts...

How to use JavaScript to determine several common browsers through userAgent

Preface Usually when making h5 pages, you need to...

Solution to Apache cross-domain resource access error

In many cases, large and medium-sized websites wi...

Detailed explanation of how to configure openGauss database in docker

For Windows User Using openGauss in Docker Pull t...

Vue uses vue meta info to set the title and meta information of each page

title: vue uses vue-meta-info to set the title an...

How to use CSS to display multiple images horizontally in the center

Let me first talk about the implementation steps:...

How to upgrade CentOS7 to CentOS8 (detailed steps)

This article uses a specific example to introduce...

Detailed explanation of Mysql's concurrent parameter adjustment

Table of contents Query cache optimization Overvi...

Complete steps to build a Laravel development environment using Docker

Preface In this article, we will use Docker to bu...