<!DOCTYPE HTML>
<html>
<script type="text/javascript">
function tanchu(){
document.getElementById("opacitys").style.display='block';
document.getElementById("content").style.display='block';
}
function close(){
document.getElementById("opacitys").style.display='none';
document.getElementById("content").style.display='none';
}
</script>
<body>
<div id="opacitys"
style="background-color:white;top:0px;left:0px;right:0px; bottom:0px;position:absolute;display:none;opacity:0.5;z-index:1000;">
</div>
<div id="content"
style="background-color:red;width:50%;height:50%;display:none;position:absolute;z-index:2000;
top: 0; left: 0; bottom: 0; right: 0;margin:auto;border:2px solid red;">
<div style="margin:10px;">
<a href=""# οnclick="close()" style="float:right;background-image:url(close.png);width:17px;height:17px;"></a>
我是显示内容我是显示内容我是显示内容我是显示内容我是显示内容我是显示内容我是显示内容我是显示内容我是显示内容
</div>
</div>
<a href="#" οnclick="tanchu()" >弹出层<a>
</body>
</html>