Display transparent images in PNG format in IE6 as normal

Source: Internet
Author: User
Tags transparent image

Users who are new to web design may encounter this problem. You need to insert a transparent image on the web page. If you use a transparent image in Gif format, the pixels may be low and the display is not clear enough. If a PNG transparent image is used, the transparency effect will not be achieved under IE6, but the background will be gray. This will make your webpage look very ugly, and no web designer wants to see such a problem. Below is a small tutorial, shows you how to display transparent images in PNG format in ie6.

Solution
First, create a DIV layer for your picture coat, like this:

<Body> <div class = "flower"> </div> </body>

Then, write in the CSS file:

Body {background-color: #000} div. flower {background: url(flower-transparent.png) no-repeat; height: 100px; width: 100px}

Er, this refers to Mozilla Firefox. To make it display normally under IE6, you should write between <! -[If gte IE 5]> <style type = "text/css"> div. flower {background: none; filter: progid: dximagetransform.microsoft.alphaimageloader(src+'flower.png ', sizingMethod = 'crop') ;}</style> <! [Endif]->

In this way, OK

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.