欢迎来到代码驿站!

HTML代码

当前位置:首页 > 网页前端 > HTML代码

div总是被select遮挡的解决方法

时间:2021-03-07 10:29:47|栏目:HTML代码|点击:
<html> 
<head> 
­ 
<meta http-equiv="Content-Type" c> 
­ 
<title>div被select遮挡的解决方法――脚本之家</title> 
</head> 
<body> 
­ 
<iframe style="position:absolute;z-index:9;width:expression

(this.nextSibling.offsetWidth);height:expression

(this.nextSibling.offsetHeight);top:expression(this.nextSibling.offsetTop);left:expression

(this.nextSibling.offsetLeft);" frameborder="0" ></iframe> 
­ 
<form id="Form1" method="post"> 
­ 
<div style="z-index:10;position:absolute;background-

color:blue;width:100;height:18;overflow:hidden;" >aaaaaaa<br/>bbbbbbb<br/>ccccccc</div> 
­ 
<select style="width:200" ><option>test0<option>test1<option>test2<option>test3</select> 
­ 
<br/> 
­ 
<pre> 
­ 
Div被Select挡住,是一个比较常见的问题。 
­ 
有的朋友通过把div的内容放入iframe或object里来解决。 
­ 
可惜这样会破坏页面的结构,互动性不大好。 
这里采用的方法是: 
虽说div直接盖不住select 
­ 
但是div可以盖iframe,而iframe可以盖select, 
­ 
所以,把一个iframe来当作div的底, 
­ 
这个div就可以盖住select了. 
</pre> 
­ 
</form> 
­ 
</body> 
</html> 

上一篇:Zen Coding css,html缩写替换大观 快速写出html,css

栏    目:HTML代码

下一篇:css支持标准的图片垂直居中

本文标题:div总是被select遮挡的解决方法

本文地址:http://www.codeinn.net/misctech/75762.html

推荐教程

广告投放 | 联系我们 | 版权申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:914707363 | 邮箱:codeinn#126.com(#换成@)

Copyright © 2020 代码驿站 版权所有