IE7 Z-Index Layering Issues

后端 未结 11 916
执念已碎
执念已碎 2020-11-22 11:31

I\'ve isolated a little test case of IE7\'s z-index bug, but don\'t know how to fix it. I have been playing with z-index all day long.

Wha

11条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 11:44

    I encountered this issue, but on a large project where HTML changes had to be requested and became a whole issue, so I was looking for a pure css solution.

    By placing position:relative; z-index:-1 on my main body content my header drop down content suddenly displayed above the body content in ie7 (it was already displaying without issue in all other browsers and in ie8+)

    The problem with that was then this disabled all hover and click actions on all content in the element with the z-index:-1 so i went to the parent element of the whole page and gave it a position:relative; z-index:1

    Which fixed the issue and retained the correct layering functionality.

    Feels a bit hacky, but worked as required.

提交回复
热议问题