CSS controls Image opacity/transparency

Source: Internet
Author: User
Tags transparent image

CSS Image Opacity/Transparency

Note: There is no CSS standard. However, engineering all modern browsers is part of W3C CSS 3 recommendations.

Example 1-create a transparent image
First, we will show you how to create a transparent image CSS.

Regular image:


 

 
  

For example, 2-image transparency-influence of mouse placement


   

   
 
    

We can see that the source code of the first line is similar to source code example 1. In addition, we have added an onmouseover attribute and an onmouseout attribute.

The image of the mouse pointer moving when the onmouseover attribute is defined. In this case, the image we want cannot be transparent when we move the mouse pointer over it.

In Firefox: this. style. opacity = 1 and IE, the syntax is: this. filters. alpha. opacity = 100.

When the mouse pointer is far away from the image, we want the image to be transparent once. This is done in the onmouseout attribute.

<Html> 
<Body>
<Div class = "background"> <div class = "transbox"> <p> This is some text that is placed in the transparent box. this is some text that is placed in the transparent box. this is some text that is placed in the transparent box. this is some text that is placed in the transparent box. this is some text that is placed in the transparent box.
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.