css property opacity

CSS Opacity attribute, a predetermined opacity, from 0.0 (fully transparent) to 1.0 (fully opaque)

opacity: value | inherit; provisions

<!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" > select a value from the following example, to change the opacity of the element. </ P >
<- to set the size of the frame length selection -!> < SELECT onChange = "ChangeOpacity (the this);" size = ". 5" > < Option /> 0 < Option /> 0.2 < Option /> 0.5 < Option /> 0.8 < Option Selected = "Selected" select> </body> </html>

Guess you like

Origin www.cnblogs.com/Su-feng-address/p/12047871.html