IE7 / IE8 z-index问题 [英] IE7 / IE8 z-index problem

查看:113
本文介绍了IE7 / IE8 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索引为-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-index值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 / IE8 z-index问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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