PNG transparent picture in IE6 normal display of pure CSS Solutions

Source: Internet
Author: User

Method One: Use PNG map as background
Pay attention to hack.
HTML code

The code is as follows Copy Code
<div class= "logo" ><a href= "/" >logo</a></div>


CSS Code

The code is as follows Copy Code
. logo {width:338px; height:57px; float:left background:url (/images/logo.png) 0px 0px no-repeat!important; text-inden T: -1000px; _background-image:none; Filter:progid:DXImageTransform.Microsoft.AlphaImageLoader (src= '/images/logo.png ', senabled= ' true ', sizingmethod= ' Scale '); }

Method Two: Insert PNG picture, define img
This method is to prepare a completely transparent picture transparent.gif, the size is random.
HTML code

The code is as follows Copy Code
<div class= "logo" ><a href= "/" ></a></div>
CSS Code
. logo {width:338px; height:57px; float:left; }
. logo img {width:338px; height:57px;}
/* PNG transparent compatible IE6 * *
. logo img {
Azimuth:expression (
This.pngset? This.pngset = true: (This.nodename = = "IMG" && this.src.toLowerCase (). IndexOf ('. png ') >-1? (This.runtimeStyle.backgroundImage = "None",
This.runtimeStyle.filter = "Progid:DXImageTransform.Microsoft.AlphaImageLoader (src= '" + this.src + "', sizingmethod= ') Image ') ',
THIS.SRC = "/images/transparent.gif"):(THIS.ORIGBG = THIS.ORIGBG? This.origBg:this.currentStyle.backgroundImage.toString (). replace (' url ("', ') '. Replace ('") ', '),
This.runtimeStyle.filter = "Progid:DXImageTransform.Microsoft.AlphaImageLoader (src= '" + THIS.ORIGBG + "", sizingmethod= ' crop ') ",
This.runtimeStyle.backgroundImage = "None"), This.pngset=true
);
}
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.