css属性opacity

CSS 属性opacity,规定不透明度,从 0.0(完全透明)到1.0(完全不透明)

opacity: value| inherit; 规定

DOCTYPE html>
<html>
<head>

<script> function ChangeOpacity(x) { // 返回被选选项的文本 var opacity=x.options[x.selectedIndex].text; var el=document.getElementById("p1"); if (el.style.opacity!==undefined) {el.style.opacity=opacity;} else {alert("Your browser doesn't support this example!");} } script>

head> <body> <p id="p1">请从下面的例子中选择一个值,以改变此元素的不透明度。p>
<select onchange="ChangeOpacity(this);" size="5"> <option />0 <option />0.2 <option />0.5 <option />0.8 <option selected="selected" />1 select> body> html>

你可能感兴趣的:(css属性opacity)