opacity

英 [???p?s?ti]? ?美 [o??p?s?ti]??

n.不透明性;費解;難懂;模糊

復數(shù): opacities

css3 opacity屬性 語法

作用:檢索或設置對象的不透明度。

說明:對于尚不支持opacity屬性的IE瀏覽器可以使用IE私有的濾鏡屬性來實現(xiàn)與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>

運行實例 ?

點擊 "運行實例" 按鈕查看在線實例