Home > Web Front-end > JS Tutorial > Code to make IE support RGBa background color_javascript skills

Code to make IE support RGBa background color_javascript skills

WBOY
Release: 2016-05-16 18:23:24
Original
1335 people have browsed it

Above code:


[Ctrl A Select all Note: If you need to introduce external Js, you need to refresh to execute ]

DXImageTransform.Microsoft.gradient filter The startColorstr parameter value in the mirror is in the form of #AARRGGBB, where AA is hexadecimal representing opacity, 00 means completely transparent, FF means fully opaque, the decimal range is 0~255, and the remaining RRGGBB is the color hexadecimal code. In the example, background: rgba(125, 0, 0, .3); represents a red background with 30% opacity. How to convert 30% opacity to hexadecimal? It's very simple. First calculate the decimal x of #AA, x/255 = 3/10, and the solution is x=3*255/10, and then convert x to hexadecimal, which is approximately equal to 4B.

Attached below are the pictures used in the examples:
Code to make IE support RGBa background color_javascript skills
Author: Zhou Mingzhi
Part of the article comes from: RGBa Browser Support

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template