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

Detailed explanation of :key in VUE v-for

When key is not added to the v-for tag. <!DOCT...

Mysql database index interview questions (basic programmer skills)

Table of contents introduction Indexing principle...

A brief discussion on why daemon off is used when running nginx in docker

I'm very happy. When encountering this proble...

Use docker to build kong cluster operation

It is very simple to build a kong cluster under t...

Use crontab to run the script of executing jar program regularly in centOS6

1. Write a simple Java program public class tests...

CSS to achieve fast and cool shaking animation effect

1. Introduction to Animate.css Animate.css is a r...

Tutorial on building svn server with docker

SVN is the abbreviation of subversion, an open so...

MySQL slow query optimization: the advantages of limit from theory and practice

Many times, we expect the query result to be at m...

MySQL cursor detailed introduction

Table of contents 1. What is a cursor? 2. How to ...

How to change the database data storage directory in MySQL

Preface The default database file of the MySQL da...

nuxt.js multiple environment variable configuration

Table of contents 1. Introduction 2. Scenario 3. ...

Tutorial on installing MySQL 5.7.28 on CentOS 6.2 (mysql notes)

1. Environmental Preparation 1.MySQL installation...

Sample code for implementing history in vuex

I have recently been developing a visual operatio...

Nginx try_files directive usage examples

Nginx's configuration syntax is flexible and ...