<div class="codetitle"> <span><a style="CURSOR: pointer" data="22768" class="copybut" id="copybut22768" onclick="doCopy('code22768')"><u>复代码码</u></a></span> 代码如下:</div> <div class="codebody" id="code22768"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 전환//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br><html xmlns="http://www.w3.org/1999/xhtml"> <br><머리> <br><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <br><title>简易弹框</title> <br><style type="text/css"> <br>.mydiv { <br>배경색: #ff6; <br>테두리: 5px 단색 #f90; <br>텍스트 정렬: 가운데; <br>줄 높이: 40px; <br>글꼴 크기: 12px; <br>글꼴 두께: 굵게; <br>z-색인:99; <br>너비: 300px; <br>높이: 120px; <br>왼쪽:50%;/*FF IE7*/ <br>상단: 50%;/*FF IE7*/ <br><br>margin-left:-150px!important;/*FF IE7 */ <br>margin-top:-60px!important;/*FF IE7 */ <br><br>margin-top:0px; <br><br>위치:고정!중요;/*FF IE7*/ <br>위치:절대;/*IE6*/ <br><br>_top: 표현식(eval(document.compatMode && <br>문서 .compatMode=='CSS1Compat') ? <br>documentElement.scrollTop (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/ <br>document.body.scrollTop (document.body.clientHeight - this .clientHeight)/2);/*IE5 IE5.5*/ <br><br>} <br><br>.bg { <br>배경색: #ccc; <br>너비: 100%; <br>높이: 100%; <br>왼쪽:0; <br>top:0;/*FF IE7*/ <br>filter:alpha(opacity=10);/*IE*/ <br>opacity:0.8;/*FF*/ <br>z-index:1 ; <br>위치:고정!중요;/*FF IE7*/ <br>위치:절대;/*IE6*/ <br><br>_top: 표현식(eval(document.compatMode && <br>document.compatMode= ='CSS1Compat') ? <br>documentElement.scrollTop (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/ <br>document.body.scrollTop (document.body.clientHeight - this.clientHeight) /2);/*IE5 IE5.5*/ <br><br>} <br>/*끝*/ <br><br></style> <br><script type="text/javascript"> <br>function showDiv(){ <br>document.getElementById('popDiv').style.display='block'; <br>document.getElementById('bg').style.display='block'; <br>} <br><br>함수 closeDiv(){ <br>document.getElementById('popDiv').style.display='none'; <br>document.getElementById('bg').style.display='none'; <br>} <br><br></script> <br><br></head> <br><br><본문> <br><br><div id="popDiv" class="mydiv" style="display:none;"><br/>弹框内容<br/> <br><a href="javascript:closeDiv()">关闭</a></div> <br><div id="bg" class="bg" style="display:none;"></div> <br><br><div style="padding-top: 20px;"> <br><input type="Submit" name="" value="点此弹框" onclick="javascript:showDiv()" /> <br></div> <br></body> <br></html> <br> </div>