CSS解决div总是被select遮挡问题的实例,只要在层里面加上IFRAME代码就可以了,看了以后就会明白,其实是很简单的。如果您对CSS的理解还不够,欢迎阅读烈火学院提供的CSS中文手册。 演示: <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>解决div总是被select遮挡的问题</title> <style> body{margin:0px;padding:0px;} #message_box{ position:absolute; width:800px; height:536px; z-index:10000; visibility:hidden; border:#000 3px solid;background-color:#FFF;margin:40px 0px 0px 50px;} #mask{ position:absolute; top:0; left:0; width:expression(body.scrollWidth); height:expression(body.scrollHeight); background:#000; filter:ALPHA(opacity=80); z-index:1; visibility:hidden} .close-what{float:right;cursor:hand;} .message{background-color:#F4F4F4;width:754px;height:200px;margin:20px 20px 20px 20px;color:#FF6600;} </style> </head> <body> <div id="message_box"><iframe src="" style="width:800px;height:536px;top:0px;left:0px;position:absolute;visibility:inherit;z-index:-1;" frameborder=0></iframe> <div class="close-what" onclick="document.getElementById('message_box').style.visibility='hidden';document.getElementById('mask').style.visibility='hidden'"><img src="/uploads/common/images/close.gif"></div> <div class="message"><p>麦田怪圈(Crop circle)是在麦田或其他农田上,透过某种力量把农作物压平而产生出几何图案。此现象在1970年代后期才开始引起公众注意。目前,有众多麦田圈事件被他人或者自己揭发为有人故意制造出来以取乐或者招揽游客。唯麦田圈中的作物“平顺倒塌”方式以及植物茎节点的烧焦痕迹并不是人力压平所能做到,也有麻省理工学院学生试图用自制设备反向复制此一现象但依然未能达成,至今仍然没有解释该现象是何种设备或做法能够达到。此点也是外星支持论者的主要物证基础。</p></div> </div> <div id="mask"></div> <table width="960" height="2603" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="960" height="303" align="center"><p><span onclick="document.getElementById('mask').style.visibility='visible';document.getElementById('message_box').style.visibility='visible'" style="cursor:hand"><a href="#">什么是麦田圈?</a></span> </p> <p> <select name="select"> <option value="西西">还能看到我吗</option> </select> </p> <p>效果演示:<a href="/" target="_blank">麦田圈</a></p> <p>只要在层里面加上下面代码就可以了~</p> <p><iframe src="" style="width:800px;height:536px;top:0px;left:0px;position:absolute;visibility:inherit;z-index:-1;" frameborder=0></iframe></p> </td> </tr> <tr> <td height="2300" align="center"></td> </tr> </table> <!-- //message_box --> </body> </html><br /><center>如不能显示效果,请按Ctrl+F5刷新本页,更多网页代码:<a href='http://www.veryhuo.com/' target='_blank'>http://www.veryhuo.com/</a></center>提示:可修改后代码再运行! 文章导航 可拖动、关闭、缩放和最小化的JS窗口代码Js模拟Win窗口,可拖动、改变大