当前位置:编程学习 > html/css >>

ie下用 iframe 盖住select 方法

ie下用 iframe 盖住select 方法

以下是一个测试的静态html,为bug重现及及解决方法。

view sourceprint?01 <!doctype html> 

02 <html> 

03 <head> 

04 <meta charset="utf-8"> 

05 <title>insert title here</title> 

06     <style type="text/css教程">        

07         #d1,#d2 { 

08             width:  400px; 

09             height : 400px; 

10         } 

11         #d1 {        

12             position : absolute; 

13             top : 100px; 

14             background : red; 

15             z-index : 1; 

16         } 

17         #d2 { 

18             position : absolute; 

19             top : 150px; 

20             background : blue; 

21             z-index : 2; 

22         } 

23     </style> 

24 </head> 

25 <body>     

26     <div id="d1">  

27         <form>             

28             <input type="text" name="username"/> 

29         </form> 

30         <p>中</p> 

31         <form> 

32             <iframe style="z-index:1"><!-- 用iframe 解决此bug -->   

33             <select name="country">                

34                 <option value="1">china</option> 

35                 <option value="2">japanese</option> 

36                 <option value="1">u.s.a</option> 

37             </select> 

38             </iframe> 

39         </form> 

40     </div>     

41     <div id="d2">ddd</div> 

42 </body> 

43 </html>

补充:Css教程,常用代码 
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,