解决在IE浏览器下div等标签会被Select表单穿过的问题

在网页中,如果将div,span等标签层叠到Select表单上时,div,span等标签会被Select表单穿过,即使设置了z-index也没用。可以通过以下方法解决。

创建一个没有边框和滚动条的iframe,并将大小及位置设置与要层叠的标签一样,z-index小于要层叠的标签即可。例:

<div style="position:absolute;width:100px;height:100px;top:0;left:0;background-color:#FF0000;z-index:100"></div>
<select></select>
<iframe scrolling="no" frameborder="0" style="position:absolute;z-index:99;width:100px;height:100px;top:0;left:0" id="fy_CP_Frame"></iframe>

posted @ 2009-03-19 16:07  YaSin  阅读(201)  评论(0)    收藏  举报