CSS Dropdown menu hidden behind content IE7

2019-02-24 20:58发布

I have a dropdown css menu that gets gets hidden behind the main page content when viewed in IE7. I've tried changing z-index values but have had no luck. I've also tried suggestions in other topics from this site but none have worked.

the page can be found here: www.melbournedodgeball.com.au/dodgeball2012/about

any help would be greatly appreciated

3条回答
手持菜刀,她持情操
2楼-- · 2019-02-24 21:13

I have test this code, It will work sure Please set this css for IE7 only

#menu {position:relative; z-index:100;}
查看更多
Luminary・发光体
3楼-- · 2019-02-24 21:29

The CSS spec's paragraph on Z-index says that new stacking context is only created for positioned content with a z-index other than auto.

You have the li inside #nav with a position:relative, an apparently IE interprets this as a new stacking context.

Try this:

#nav li {
    display: block;
    position: relative;
    z-index: 1;         // force IE to recognize stack at this point
}
查看更多
祖国的老花朵
4楼-- · 2019-02-24 21:30

You need to add

position:relative;

To your <ul>

Z-Index is specified relative to all other elements in the same stacking context. You can have a Z-Index of 100 but it wont make a bit of difference if the elements belong to completely different stacking contexts.

查看更多
登录 后发表回答