Home > Article > Web Front-end > How to resolve the compatibility issues with transparency in IE 6, 7, and 8
This is my first time writing a blog, let me write about the problems I encountered today
When I was doing page transparency today, I used IE7 to test it and found that it had no effect. The original code is as follows
.mask { width: 100%; height: 100%; position: fixed; left: 0; top: 0; background: rgba(0,0,0,.2); display: none; }
In this case, it was found that it was incompatible, so I used another way of writing, set a background, and then set the opacity attribute to 0.4. I found that it still didn't work. I asked the teacher and found out that I need to add a line to achieve compatibility with IE6, 7, and 8
The changed code is as follows:
.mask { width: 100%; height: 100%; position: fixed; left: 0; top: 0; background-color: #000; opacity: 0.2; filter: alpha(opacity = 20);/* 兼容IE6、7、8 */ display: none; }
This way it will be perfectly compatible with IE.
The above is the detailed content of How to resolve the compatibility issues with transparency in IE 6, 7, and 8. For more information, please follow other related articles on the PHP Chinese website!