CSS opacity-code to achieve translucent effects of images _ experience Exchange

Source: Internet
Author: User
A few days ago a friend who made web design asked me this question: how to achieve the translucent effect of the image through CSS, and can be supported on IE and Mozilla. Here is my method to share with you.

Picture transparency effect for CSS

This effect works on both IE and Mozilla browsers, the code is as follows
this.filters.alpha.opacity=100 "onmouseout=" this.style.mozopacity=0.5;
This.filters.alpha.opacity=50 ">

In IE, you need to use "filter" to define the transparency "opacity", and in Mozilla can directly parse "opacity", so if you want to make this effect in both browsers are supported, you need to add both settings. For IE settings: this.filters.alpha.opacity=50 and for Mozilla settings: this.style.mozopacity=0.5. You can directly use this line of code to the image definition, 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.