复制代码代码如下:
<! 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">
<голова>
<meta http-equiv = "content-type" content = "text /html; charset = utf-8" />
<title> 简易弹出框 </title>
<стиль типа = "text/css">
.mydiv {
фоновый цвет: #ff6;
Граница: 5px Solid #F90;
Текст-альбом: Центр;
высота линии: 40px;
размер шрифта: 12px;
шрифт-вес: жирный шрифт;
Z-Index: 99;
Ширина: 300px;
Высота: 120px;
Слева: 50%;/*ff IE7*/
Верх: 50%;/*ff IE7*/
Margin-Lefft: -150px! Важно;/ *ff ie7 */
Margin-Top: -60px! Важно;/ *ff ie7 */
маржинальная версия: 0px;
позиция: исправлена! Важно;/*ff IE7*/
позиция: абсолют;/*ie6*/
_top: Expression (eval (document.compatmode &&
document.compatmode == 'css1compat')?
documentElement.scrolltop + (document.documentelement.clientheight-this.offsetheight)/2:/*ie6*//
document.body.scrolltop + (document.body.clientHeight - this.clientHeight)/2);/*IE5 IE5.5*/
}
.bg {
фоновый цвет: #CCC;
Ширина: 100%;
высота: 100%;
слева: 0;
Верх: 0;/*ff ie7*/
Фильтр: альфа (непрозрачность = 10);/*т.е.*/
непрозрачность: 0,8;/*ff*/
z-index: 1;
позиция: исправлена! Важно;/*ff IE7*/
позиция: абсолют;/*ie6*/
_top: Expression (eval (document.compatmode &&
document.compatmode == 'css1compat')?
documentElement.scrolltop + (document.documentelement.clientheight-this.offsetheight)/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';
}
функция закрыто
document.getElementbyId ('popdiv'). style.display = 'none';
document.getElementbyId ('bg'). style.display = 'none';
}
</script>
</head>
<тело>
<div id = "popdiv" style = "display: none;"> <br/> 弹框内容 <br/>
<a href = "javascript: blostiv ()"> 关闭 </a> </div>
<div id = "bg" style = "display: none;"> </div>
<div style = "padding-top: 20px;">
<input type = "отправить" name = "" value = "点此弹框" onclick = "javascript: showdiv ()" />
</div>
</body>
</html>