Css sets the element Transparency Code instance and css element transparency instance.

Source: Internet
Author: User

Css sets the element Transparency Code instance and css element transparency instance.

Sample Code for setting element transparency in css:
This topic describes how to set the transparency of an element. Currently, many effects are available. The following describes how to achieve this effect.
W3c provides a standard attribute opacity for setting transparency. The value of this attribute is between 0 and 1, and 0 is completely transparent. 1 is completely opaque.
The Code is as follows:

 

<! DOCTYPE html> 

 

The above code can be executed perfectly in Google and Firefox browsers, but it is not successful in IE8 and IE8 browsers, because they do not support the opacity attribute.
The code is modified as follows:

 

<! DOCTYPE html> 

 

The above Code meets our requirements, that is, the filter: alpha (opacity = 30) is added. This IE browser supports it. Note that the opacity value in the brackets is 0, 0 indicates full transparency, and 100 indicates full opacity.

The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 12918.

For more information, see: http://www.softwhy.com/divcss/

 

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.