Because I know some web page production technology, I heard a long time ago that translucent PNG files will have problems displaying under IE6, but since I have never really encountered them, I have never encountered them.
I started building my own website at the beginning of this year. I used a png picture with a transparent part to make the website logo. I thought it was a time, so I don’t have to consider IE6 anymore. One day when I came back from get off work and opened the Google Analytics backend, I found that IE6's visits actually accounted for 40% of the total. I was shocked and quickly got off the green version of IE6 from the Internet to test my own website. Sure enough, the LOGO was completely opaque.
So I searched for solutions overnight. Generally speaking, the online methods are generally more complicated, including css filters, js, gif replacement, etc. But I always feel that it is not beautiful enough. Finally, after a night of searching, I found a solution that can be smoothly solved with only 2 sentences of js code. Next, share with you
First, download iepng.js from my website
http://www. *** .com/templates/default/js/iepng.js
If your website uses translucent png as the background element id as logo, add it between <head></head>:
<!-- for ie6 png fix --> <script type="text/javascript" src="templates/js/iepng.js"></script> <script type=text/javascript> EvPNG.fix('#logo');</script> |
Finally, let me explain that if you use transparent png as background div id as foo, then it should be written as:
EvPNG.fix('#foo'); |
If you use transparent png as background div class as bar, then you should write it as:
EvPNG.fix('.bar"); |
The syntax is the same as CSS, OK, I hope to continue to exchange website building skills with you.