How to use DD_belatedPNG to make IE6 support PNG transparent images?
Use DD_belatedPNG to make IE6 support PNG transparent images
Recommended learning: 梦Weavercms
As we all know, IE6 does not support transparent PNG images. In terms of expressiveness in Web design, PNG images have effects that other graphic formats cannot achieve. This fatal flaw of IE6 greatly limits the creative expression of Web design.
Although there are many ways to solve the problem of transparent PNG in IE6, from using IE-specific filters or e-xpression to javascript transparent GIF replacement. However, these methods have a disadvantage, that is, they do not support CSS. background-position and background-repeat attributes.
The use of DD_belatedPNG.js can perfectly solve the problem of PNG image transparency under IE6, and supports background-position and background-repeat. This is not available in other methods. At the same time, DD_belatedPNG also supports the a:hover attribute. and .
Our website has added DD_belatedPNG to process navigation PNG transparent images so that it maintains the same appearance under different browsers.
Usage:
First download the JS file
http://www.028guzheng.com/793395_16370305896/DD_belatedPNG_0.0.8a.js
and then quote the code on the page:
<!--[if IE 6]> <script type="text/javascript" ></script> <script> DD_belatedPNG.fix('css选择器,应用类型'); </script> <![endif]-->
The reference function is DD_belatedPNG.fix(), brackets Fill in the CSS selector for applying PNG (ID selector and class selector can be used) and application type (divided into img and background).
Such as DD_belatedPNG.fix(‘#box-one, img’) or DD_belatedPNG.fix(‘.header, background’) etc.
These can be abbreviated as DD_belatedPNG.fix(‘#box-one, .header, img,background’); .
More selectors such as DD_belatedPNG.fix(‘#box-one, .header,#footer,.box-two a:hover, img,background’); etc.
In addition, in order to solve the problem of background image flickering under IE6, you can add the following script to the page
<!–-[if IE 6]> <script type=”text/javascript”> // <![CDATA[ if((window.navigator.appName.toUpperCase().indexOf("MICROSOFT")>=0)&&(document.execCommand)) try{ document.execCommand("BackgroundImageCache", false, true); } catch(e){} // ]]> </script> <![endif]–->
The above is the detailed content of How to use DD_belatedPNG to make IE6 support PNG transparent images. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

WebStorm Mac version
Useful JavaScript development tools

Dreamweaver CS6
Visual web development tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.
