Home > Web Front-end > JS Tutorial > body text

How to resolve the compatibility issues with transparency in IE 6, 7, and 8

一个新手
Release: 2017-10-11 09:54:47
Original
1428 people have browsed it

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

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

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!

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