Translucent backgrounds compatible with RGBA colors under IE8

Source: Internet
Author: User

Make a picture translucent matte at work found incompatible under IE8

A look again know IE8 does not support RGBA color, and then search compatibility method, did not think so quickly solved.

First talk about the meaning of Rgba:

R represents Red,g on behalf of Green,b on behalf of Blue,a for transparency. Red, green and blue are three primary colors, all of which can be composed of these three colors. For example, Rgba (0,0,0,.5) is a 0.5 transparency black. Modern browsers support Rgba, but in IE8 and other antique-level browsers do not support RGBA, IE8 can only reluctantly support the RGB () function (that is, remove the transparency, can only represent color).

The solutions on the Web are:

Background:rgba (0,0,0,. 5); / * browsers that support RGBA * /

Filter:progid:DXImageTransform.Microsoft.gradient (startcolorstr=#7f000000, endcolorstr= #7f000000);/*IE8 Support */

The second sentence means to execute when the transparency of the previous line does not work. The meaning of this sentence is used to make the gradient, but this place does not need a gradient. So two colors are set to the same color.

Explain the next #7f000000, the first part is the 7f behind the # number. is the Iefilter value of the RGBA transparency 0.5. From 0.1 to 0.9 each number corresponds to a iefilter value. The corresponding relationship is as follows:

The second part is six bits after 19. This is the color value of the six binary. Is the same as the value in the RGB function. For example, RGB (0,0,0) corresponds to #000;

Here, the use of RGBA can be compatible with IE8.

But the practice has found that this method can only be used on the background color, foreground color or other is powerless

Translucent backgrounds compatible with RGBA colors under IE8

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.