Salinan kode adalah sebagai berikut:
<! Doctype html public "-// w3c // dtd xhtml 1.0 transisi // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv = "konten tipe" content = "text /html; charset = gbk" />
<title> unt judul dokumen </iteme>
<type style = "text/css">
/* Gaya lapisan pop-up*/
html, tubuh {tinggi: 100%; margin: 0px; Ukuran font: 12px;}
.mydiv {
latar belakang-warna: #ff6;
Perbatasan: 1px Solid #F90;
Teks-Align: tengah;
Line-Height: 40px;
font-size: 12px;
font-weight: tebal;
z-index: 99;
Lebar: 300px;
Tinggi: 120px;
Kiri: 50%;/*ff IE7*/
TOP: 50%;/*ff IE7*/
margin-left: -150px! Penting;/*ff ie7 Nilai ini setengah lebar dari dirinya sendiri*/
margin-top: -60px! Penting;/*ff ie7 Nilai ini setengah lebih tinggi*/
margin-top: 0px;
Posisi: diperbaiki! Penting;/*ff IE7*/
Posisi: absolute;/*ie6*/
_top: ekspresi (eval (dokumen.compatmode &&
Dokumen.comPatMode == 'CSS1COMPAT')?
DocumentElement.scrolltop + (Document.DocumentElement.ClientHeight- this.offsetHeight)/2:/*ie6*/
document.body.scrolltop + (document.body.clientHeight - this.clientHeight)/2);/*ie5 ie5.5*/
}
.bg {
Latar Belakang-Color: #CCC;
Lebar: 100%;
Tinggi: 100%;
Kiri: 0;
TOP: 0;/*ff IE7*/
filter: alpha (opacity = 50);/*yaitu*/
opacity: 0.5;/*ff*/
z-index: 1;
Posisi: diperbaiki! Penting;/*ff IE7*/
Posisi: absolute;/*ie6*/
_top: ekspresi (eval (dokumen.compatmode &&
Dokumen.comPatMode == 'CSS1COMPAT')?
DocumentElement.scrolltop + (Document.DocumentElement.ClientHeight- this.offsetHeight)/2:/*ie6*/
document.body.scrolltop + (document.body.clientHeight - this.clientHeight)/2);/*ie5 ie5.5*/
}
/*Akhir*/
</tyle>
<type skrip = "Teks/JavaScript">
fungsi showdiv () {
document.geteLementById ('PopDiv'). style.display = 'block';
document.geteLementById ('bg'). style.display = 'block';
}
function closeV () {
document.geteLementById ('PopDiv'). style.display = 'none';
document.geteLementById ('bg'). style.display = 'none';
}
</script>
</head>
<body>
<Div id = "PopDiv" style = "display: none;"> Selamat! <br/> Nilai Anda adalah: 60 poin <br/>
<a href = "javascript: closedIv ()"> Tutup jendela </a> </div>
<Div id = "bg" style = "display: none;"> </div>
<Div style = "padding-top: 20px;">
<input type = "kirim" name = "" value = "Display Layer" OnClick = "JavaScript: showDiv ()" />
</div>
</body>
</html>