复制代码代码如下::
<! DocType html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transsitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<kopf>
<meta http-äquiv = "content-type" content = "text /html; charset = utf-8" />
<title> 简易弹出框 </title>
<style type = "text/css">
.Mydiv {
Hintergrundfarbe: #ff6;
Grenze: 5px fest #f90;
Text-Align: Mitte;
Zeilenhöhe: 40px;
Schriftgröße: 12px;
Schriftgewicht: fett;
Z-Index: 99;
Breite: 300px;
Höhe: 120px;
links: 50%;/*ff ie7*/
TOP: 50%;/*ff IE7*/
Rand-Links: -150px! Wichtig;/ *ff IE7 *//
Rand: -60px! Wichtig;/ *ff IE7 */
Rand: 0px;
Position: behoben! Wichtig;/*ff IE7*/
Position: absolut;/*IE6*/
_top: expression (eval (document.compatmode &&
document.compatmode == 'CSS1Compat')?
documentElement.scrolltop + (document.documentElement.clientHeight-this.offseteight)/2:/*IE6*//
document.body.scrolltop + (document.body.clientHeight - this.clientHeight)/2);/*IE5 IE5.5*//
}
.bg {
Hintergrundfarbe: #CCC;
Breite: 100%;
Höhe: 100%;
links: 0;
ober: 0;/*ff ie7*/
Filter: Alpha (Opazität = 10);/*IE*/
Deckkraft: 0.8;/*ff*/
Z-Index: 1;
Position: behoben! Wichtig;/*ff IE7*/
Position: absolut;/*IE6*/
_top: expression (eval (document.compatmode &&
document.compatmode == 'CSS1Compat')?
documentElement.scrolltop + (document.documentElement.clientHeight-this.offseteight)/2:/*IE6*//
document.body.scrolltop + (document.body.clientHeight - this.clientHeight)/2);/*IE5 IE5.5*//
}
/*Das Ende*/
</style>
<script type = "text/javaScript">
Funktion showDiv () {
document.getElementById ('popdiv'). style.display = 'block';
document.getElementById ('bg'). style.display = 'block';
}
function closeiv () {
document.getElementById ('popdiv'). style.display = 'keine';
document.getElementById ('bg'). style.display = 'keine';
}
</script>
</head>
<body>
<div id = "popdiv" style = "display: keine;"> <br/> 弹框内容 <br/>
<a href = "javaScript: closeiv ()"> 关闭 </a> </div>
<div id = "bg" style = "display: keine;"> </div>
<div style = "padding-top: 20px;">
<Eingabe type = "surug" name = "" value = "点此弹框" onclick = "JavaScript: showDiv ()" />
</div>
</body>
</html>