CSS opacity-code for Implementing Image translucent Effect

Source: Internet
Author: User

A friend who made web design a few days ago asked me this question: how to use CSS to achieve the translucent Effect of images, and can be supported by IE and Mozilla. I will share my methods with you.

For image transparency through CSS

This effect works on both IE and Mozilla browsers. The Code is as follows:

This. filters. alpha. opacity = 100 "onmouseout =" this. style. Required opacity = 0.5;
This. filters. alpha. opacity = 50 ">

In IE, you need to use "filter" to define transparency "opacity". In Mozilla, you can directly parse "opacity ", therefore, if you want to make this effect supported in both browsers, you need to add both settings. For IE settings: this. filters. alpha. opacity = 50 but for Mozilla: this. style. required opacity = 0.5. you can use this line of code to define images. You only need to modify the image address to achieve the effect.

Image with link:

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.