<SCRIPT type = "text/JavaScript"> function a () {var n = document. getelementbyid ('show'); N. style. visibility = "visible";} function B () {var n = document. getelementbyid ('show'); N. style. visibility = "hidden" ;}</SCRIPT> <body bgcolor = "#669900"> <Div id = "show" style = "position: absolute; width: 100%; height: 100%; Background-color: #000000; filter: alpha (opacity = 70); opacity: 0.7; visibility: hidden; "> <Div style =" width: 500px; height: 300px; margin: 0 auto; Background-color: # ffffff; margin-top: 200px; "align =" center "> <button onclick =" B () "Style =" margin-top: 100px; "> click here </button> </div> <button onclick =" () "> click me </button> </body>
Implementation principle:
Visibility
Filter: alpha (opacity = 70);, opacity: 0.7; (write two for compatibility considerations)
Position: absolute;
Is to make it do not affect the Layout
If you want to improve it, you 'd better add zindex = 1000;
However, if there is only one position: absolute; layer
I personally feel that it is unnecessary ......