コードコピーは次のとおりです。
<!doctype html public " - // w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<Meta http-equiv = "content-type" content = "text /html; charset = gbk" />
<title> un unt ittitled document </title>
<style type = "text/css">
/*ポップアップレイヤーのスタイル*/
html、body {height:100%;マージン:0px; font-size:12px;}
.mydiv {
バックグラウンドカラー:#ff6;
ボーダー:1pxソリッド#F90;
テキストアライグ:センター;
Line-Height:40px;
フォントサイズ:12px;
font-weight:bold;
z-index:99;
幅:300px;
高さ:120px;
左:50%;/*ff ie7*/
上:50%;/*ff ie7*/
マージン左:-150px!重要;/*ff ie7この値はそれ自体の幅の半分です*/
マージントップ:-60px!
マージントップ:0px;
位置:修正!重要;/*ff ie7*/
位置:絶対;/*ie6*/
_top:expression(eval(document.compatmode &&
document.comPatMode == 'CSS1Compat')?
documentlement.scrolltop +(document.documentelement.clientheight-this.offseeth)/2:/*ie6*/
document.body.scrolltop +(document.body.clientheight -this.clientheight)/2);/*ie5 ie5.5*/
}
.bg {
バックグラウンドカラー:#ccc;
幅:100%;
高さ:100%;
左:0;
TOP:0;/*ff ie7*/
フィルター:アルファ(不透明= 50);/*ie*/
不透明度:0.5;/*ff*/
z-index:1;
位置:修正!重要;/*ff ie7*/
位置:絶対;/*ie6*/
_top:expression(eval(document.compatmode &&
document.comPatMode == 'CSS1Compat')?
documentlement.scrolltop +(document.documentelement.clientheight-this.offseeth)/2:/*ie6*/
document.body.scrolltop +(document.body.clientheight -this.clientheight)/2);/*ie5 ie5.5*/
}
/*終わり*/
</style>
<script type = "text/javascript">
関数showdiv(){
document.getElementById( 'popdiv')。style.display = 'block';
document.getElementById( 'bg')。style.display = 'block';
}
function closediv(){
document.getElementById( 'popdiv')。style.display = 'none';
document.getElementById( 'bg')。style.display = 'none';
}
</script>
</head>
<body>
<div id = "popdiv" style = "display:none;">おめでとうございます! <br/>あなたの成績は:60ポイント<br/>です
<a href = "javascript:clositiv()">ウィンドウを閉じます</a> </div>
<div id = "bg" style = "display:none;"> </div>
<div style = "padding-top:20px;">
<入力型= "submit" name = "" value = "displayレイヤー" onclick = "javascript:showdiv()" />
</div>
</body>
</html>