<br><div class="msgheader"> <div class="right"><span style="CURSOR: pointer" onclick="copycode(getid('phpcode2'));"><u>Copy code</u></span></div>The code is as follows:</div> <div class="msgborder" id="phpcode2"> <br><!DOCTYPE html PUBLIC "-//W3C/ /DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> .org/1999/xhtml"> <br><head> <br><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <br> <title>Untitled Document</title> <br><style type="text/css"> <br>/*STYLE of the popup layer*/ <br>html,body {height:100%; margin:0px; font-size:12px;} <br>.mydiv { <br>background-color: #ff6; <br>border: 1px solid #f90; <br>text-align: center; <br>line -height: 40px; <br>font-size: 12px; <br>font-weight: bold; <br>z-index:99; <br>width: 300px; <br>height: 120px; <br>left :50%;/*FF IE7*/ <br>top: 50%;/*FF IE7*/ <br>margin-left:-150px!important;/*FF IE7 This value is half of its width*/ <br>margin-top:-60px!important;/*FF IE7 The value is half of its height*/ <br>margin-top:0px; <br>position:fixed!important;/*FF IE7*/ <br>position:absolute;/*IE6*/ <br>_top: expression(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>. bg { <br>background-color: #ccc; <br>width: 100%; <br>height: 100%; <br>left:0; <br>top:0;/*FF IE7*/ <br>filter:alpha(opacity=50);/*IE*/ <br>opacity:0.5;/*FF*/ <br>z-index:1; <br>position:fixed!important;/*FF IE7* / <br>position:absolute;/*IE6*/ <br>_top: expression(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>/*The END*/ <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>function closeDiv(){ <br>document.getElementById('popDiv ').style.display='none'; <br>document.getElementById('bg').style.display='none'; <br>} <br></script> <br></head> ; <br /><body> <br><div id="popDiv" class="mydiv" style="display:none;">title<br/>You know<br/> <br><a href="javascript:closeDiv()">Close window</a></div> <br><div id="bg" class="bg" style="display:none ;"></div> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <br><div style="padding-top: 20px;"> <br><input type="Submit" name="" value=" Show layer" onclick="javascript:showDiv()" /> <br></div> <br></body> <br></html> <br><br> </div>Append a Nice style<br><br><br><div class="msgheader"> <div class="right"> <span style="CURSOR: pointer" onclick="copycode(getid('phpcode3'));">Copy code<u></u></span>The code is as follows:</div> <div class="msgborder" id="phpcode3"> <br><html> <br><head><title></title> <br><style> <br>.mesWindowTop { <br>font-size: 12px; <br>font-weight: bold; <br>text-align: left; <br>} <br>.mesWindowContent { <br>font-size: 12px; <br>} <br>.mesWindow { <br>background: none repeat scroll 0 0 #FFFFFF; <br>border: 1px solid #666666; <br>} <br></style> <br></head> <br><body> <br><div id="mesWindow" class="mesWindow" style="top: 180px; position: absolute; width: 600px; margin-left: -300px; left: 50%; z-index: 9999;"><div class="mesWindowTop"><table width="100%" height="100%"><tbody><tr><td>窗口标题</td><td style="width:1px;"><input type="button" value="关闭" class="close" title="关闭窗口" onclick="closeWindow();"></td></tr></tbody></table></div><div id="mesWindowContent" class="mesWindowContent"><div style="padding:20px 0 20px 0;text-align:center">消息正文</div></div><div class="mesWindowBottom"></div></div> <br></body> <br></html> <br> </div> </div>