Home >Web Front-end >CSS Tutorial >Why Isn\'t My CSS Background Opacity Working in IE8?

Why Isn\'t My CSS Background Opacity Working in IE8?

Linda Hamilton
Linda HamiltonOriginal
2024-11-26 02:03:08403browse

Why Isn't My CSS Background Opacity Working in IE8?

CSS Background Opacity Not Working in IE 8

This CSS for background opacity of a

is not working in IE 8:

background: rgba(255, 255, 255, 0.3);

It works fine in Firefox but not in IE 8. How can we make it work?

Solution

To simulate RGBA and HSLA background in IE, we can use a gradient filter with the same start and end color (the alpha channel is the first pair in the value of HEX):

background: rgba(255, 255, 255, 0.3); /* browsers */
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#4cffffff', endColorstr='#4cffffff'); /* IE */

The above is the detailed content of Why Isn\'t My CSS Background Opacity Working in IE8?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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