IE7不尊重z-index [英] IE7 does not respect z-index

查看:109
本文介绍了IE7不尊重z-index的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在兼容模式下运行,下面的日历呈现在下面的文本框后面. IE8显示日历的方式.

Running in compatibility mode the calendar below renders behind the textboxes below. IE8 displays the calendar how I need it to.

我的CSS

.MyCalendar .ajax__calendar_container 
{
border:1px solid #7F9DB9; 
background-color: #ffffff; 
z-index : 1004 ;   
width:190px;
}

覆盖日历的文本框没有在任何地方设置其z-index,尽管我在服务器端代码中尝试了将其z-index设置为-1(如果我没有检测到IE7的情况).有什么建议?

the textboxes which are overlaying the calendar don't have their z-index set anywhere although I have tried in my server side code to set their z-index to -1 if I detect IE7 to no avail. Any suggestions?

推荐答案

IE在使用z-index时遇到问题.大多数浏览器将页面视为一个连续的堆栈上下文,但是在IE中,定位的元素会生成一个新的堆栈上下文,其z索引值为0.

IE has problems with z-index. Most browsers treat the page as one continuous stacking context, but in IE, positioned elements generate a new stacking context, starting with a z-index value of 0.

如本文所述:

http://trwa.ca/2012/03/ie-z-index-bug-and-how-to-squash-it/

尝试为日历的父元素赋予更高的z-index.

try giving the calendar's parent element an even higher z-index.

这篇关于IE7不尊重z-index的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆