Copy codeThe Code is as follows:
<! 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 = UTF-8"/>
<Title> simple pop-up box </title>
<Style type = "text/css">
. Mydiv {
Background-color: # ff6;
Border: 5px solid # f90;
Text-align: center;
Line-height: 40px;
Font-size: 12px;
Font-weight: bold;
Z-index: 99;
Width: 300px;
Height: 120px;
Left: 50%;/* FF IE7 */
Top: 50%;/* FF IE7 */
Margin-left:-150px! Important;/* FF IE7 */
Margin-top:-60px! Important;/* FF IE7 */
Margin-top: 0px;
Position: fixed! Important;/* FF IE7 */
Position: absolute;/* IE6 */
_ Top: expression (eval (document. compatMode &&
Document. compatMode = 'css1compat ')?
DocumentElement. scrollTop + (document.doc umentElement. clientHeight-this.offsetHeight)/2:/* IE6 */
Document. body. scrollTop + (document. body. clientHeight-this. clientHeight)/2);/* IE5 IE5.5 */
}
. Bg {
Background-color: # ccc;
Width: 100%;
Height: 100%;
Left: 0;
Top: 0;/* FF IE7 */
Filter: alpha (opacity = 10);/* IE */
Opacity: 0.8;/* FF */
Z-index: 1;
Position: fixed! Important;/* FF IE7 */
Position: absolute;/* IE6 */
_ Top: expression (eval (document. compatMode &&
Document. compatMode = 'css1compat ')?
DocumentElement. scrollTop + (document.doc umentElement. clientHeight-this.offsetHeight)/2:/* IE6 */
Document. body. scrollTop + (document. body. clientHeight-this. clientHeight)/2);/* IE5 IE5.5 */
}
/* The END */
</Style>
<Script type = "text/javascript">
Function 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" class = "mydiv" style = "display: none;"> <br/> dialog box content <br/>
<A href = "javascript: closeDiv ()"> close </a> </div>
<Div id = "bg" class = "bg" style = "display: none;"> </div>
<Div style = "padding-top: 20px;">
<Input type = "Submit" name = "" value = "click this bullet box" onclick = "javascript: showDiv ()"/>
</Div>
</Body>
</Html>