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
Release: 2024-11-26 02:03:08
Original
315 people have browsed it

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);
Copy after login

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 */
Copy after login

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!

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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template