div總是被select遮擋的解決方法
更新時間:2008年06月25日 21:33:31 作者:
這個方法好像可行,但前提是div層的大小、位置可知,對于在后臺js文件中控制style的div就實效了。 我遇到的恰好就是這種情況,所以太遺憾了。 不過這個帖子還是應(yīng)該收藏一下。
<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的內(nèi)容放入iframe或object里來解決。
可惜這樣會破壞頁面的結(jié)構(gòu),互動性不大好。
這里采用的方法是:
雖說div直接蓋不住select
但是div可以蓋iframe,而iframe可以蓋select,
所以,把一個iframe來當作div的底,
這個div就可以蓋住select了.
</pre>
</form>
</body>
</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的內(nèi)容放入iframe或object里來解決。
可惜這樣會破壞頁面的結(jié)構(gòu),互動性不大好。
這里采用的方法是:
雖說div直接蓋不住select
但是div可以蓋iframe,而iframe可以蓋select,
所以,把一個iframe來當作div的底,
這個div就可以蓋住select了.
</pre>
</form>
</body>
</html>
相關(guān)文章
[轉(zhuǎn)]目前找到的最好的Iframe自適應(yīng)高度代碼
[轉(zhuǎn)]目前找到的最好的Iframe自適應(yīng)高度代碼...2007-02-02CSS定位中Positoin、absolute、Relative的一些研究
用Div+CSS進行網(wǎng)站布局時,做一些浮動層等特殊特殊效果時要考慮到定位問題。這就要用到Positoin屬性等。2008-10-10用iframe margin實現(xiàn)調(diào)用其他網(wǎng)頁的某一區(qū)域的方法
用iframe margin實現(xiàn)調(diào)用其他網(wǎng)頁的某一區(qū)域的方法...2007-12-12一點小小的創(chuàng)意css鼠標放上去則顯示電話號碼
一點小小的創(chuàng)意css鼠標放上去則顯示電話號碼...2007-10-10