The opacity transparency of the module conflicts with the Shadow transparency of PNG.

Source: Internet
Author: User

Transparent settings of the module: filter: alpha (opacity = 80); opacity: 0.8;

PNG transparent settings: Make the PNF-24 mode directly when the image with transparency can be

Problem:

One problem found today when handling the F7Dialog2.0 project, that is, after setting the transparency of a module in IE, if there is a picture with a translucent PNG-24 inserted or set the background in the module, then the translucent rendering will be wrong, the image is ugly.

Cause:

After research and judgment, it is a filter attribute problem. I don't know about the parameters and the rendering mode of the browser. This is a bit deep, I have only used the opacity of alpha for the parameter of IE exclusive filter, and I am not interested in figuring out anything else.

Solution:

Judging from my current knowledge, the two cannot coexist. With the module transparency, do not display a PNG with transparency in it unless you give up IE browser.

So I chose IE6 to use CSS to set the module transparency. other browsers use PNG to set the image transparency.

Example:
Look at the adjusted CSS:
Background-image: url ("../img/yahoo_style_side.png ");
_ Background-image: url ("../img/yahoo_style_side_ie6.png ");
_ Filter: alpha (opacity = 80 );

The first line is to set up a PNG image with a translucent image for IE6's unexpected browser.
The second line sets an independent non-translucent image for IE6.
Row 3 sets the module transparency for IE6

In addition, the transparency set in the PNG-24 image needs to be consistent with the transparency set in IE6 CSS, so that the experience is closer.

Based on the above situation, the following results are achieved: Except for IE6, PNG is not supported, but it supports module transparency. Other browsers support PNG transparency;

Therefore, when there is no gradient shadow in your PNG image, the two will achieve the same effect.

Of course, if your PNG image is not in the translucent module, this will not happen.

Note: IE5 and earlier versions are not considered.

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.