How is the opacity attribute used in CSS3?:<length> inherit
Length: A value of 0 to 1, consisting of floating-point numbers and unit identifiers. is not a negative value. The default value is: 1.
The function of this label is to declare the transparency of an element, and the element with a value of 1 is completely opaque, whereas a value of 0 is completely opacity and invisible. Any value from 1 to 0 indicates the degree of transparency of the element.
Compatible: Firefox 3.0.10, Chrome 2.0.x, Opera 9.64, Safari 4, Firefox 3.5
The older version of Firefox, we need to use the-moz-prefix, and for the old Safari/chrome version, we need to use the-webkit-prefix. For the older safari version that uses the khtml kernel instead of the WebKit kernel, we need to use-khtml-. So if we want to support every browser, our code should be like this: opacity:0.5; -moz-opacity:0.5; -webkit-opacity:0.5; -khtml-opacity:0.5;
For IE does not support using a filter: Filter:alpha (opacity=50), ie we need to use integers from 0 to 100, IE8 provides a new way to place:-ms-filter: "Progid:d XImageTransform.Microsoft.Alpha (opacity=50) ";
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > < HTML xmlns= "http://www.w3.org/1999/xhtml" > <pead> <meta http-equiv= "Content-type" content=; Charset=utf-8 "/> <meta http-equiv= content-language" content= "Utf-8"/> <meta name= "robots" content= "all" /> <meta name= "Author" content= "TENCENT-ISRD"/> <meta name= "Copyright" content= "Tencent"/> <style > img.opacity1 {opacity:0.25} img.opacity2 {opacity:0.50;} img.opacity3 {opacity:0.75;} </style> <TITLE&G t;opacity</title> </pead> <body> <div></div> <div></div> < Div></div> </body> </ptml> </ textarea> </p>