opacity

英 [əʊˈpæsəti]   美 [oʊˈpæsəti]  

n.不透明性;费解;难懂;模糊

复数: opacities

css3 opacity属性 语法

作用:检索或设置对象的不透明度。

说明:对于尚不支持opacity属性的IE浏览器可以使用IE私有的滤镜属性来实现与opacity相同的效果

css3 opacity属性 示例

<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8" />
<title></title>
<style>
h1 {
	margin: 10px 0;
	font-size: 16px;
}
.test,
.test2 {
	width: 300px;
	height: 150px;
	padding: 10px;
}
.test {
	background:#050;
}
.test2 {
	margin: -120px 0 0 50px;
	background: #000;
	filter: alpha(opacity=50);
	opacity: .5;
	color: #fff;
}
</style>
</head>
<body>
<h1>下例是一个半透明的效果:</h1>
<div class="test">不透明度为100%的box</div>
<div class="test2">不透明度为50%的box</div>
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

热门推荐

最新文章