1. <html> 
  2.     <head> 
  3.         <title></title> 
  4.         <meta http-equiv="content-Type" content="text/html;charset=gb2312"> 
  5.         <!-- 把下面代码加到<head>与</head>之间--> 
  6.         <style type="text/css"> 
  7.             .black_overlay {  
  8.                 display: none;  
  9.                 position: absolute;  
  10.                 top: 0%;  
  11.                 left: 0%;  
  12.                 width: 100%;  
  13.                 height: 100%;  
  14.                 background-color: black;  
  15.                 z-index: 1001;  
  16.                 -moz-opacity: 0.8;  
  17.                 opacity: .80;  
  18.                 filter: alpha(opacity = 80);  
  19.             }  
  20.               
  21.             .white_content {  
  22.                 display: none;  
  23.                 position: absolute;  
  24.                 top: 25%;  
  25.                 left: 25%;  
  26.                 width: 50%;  
  27.                 height: 50%;  
  28.                 padding: 16px;  
  29.                 /**  
  30.                 border: 16px solid orange;  
  31.                 **/  
  32.                 background-color: white;  
  33.                 z-index: 1002;  
  34.                 overflow: auto;  
  35.             }  
  36.         </style> 
  37.     </head> 
  38.     <body> 
  39.         <!--把下面代码加到<body> 与</body>之间--> 
  40.         <input type="radio" onclick="document.getElementById('light').style.display='block'; document.getElementById('fade').style.display='block'"> 
  41.         <div id="light" class="white_content"> 
  42.         <input type="button" value="关闭" onclick="document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'"></a> 
  43.         </div> 
  44.         <div id="fade" class="black_overlay"> 
  45.         </div> 
  46.     </body> 
  47. </html> 

 这个效果很好的大家可以去试试很多地方用的到!