开发者

My z-index property is not getting set [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
开发者_如何学Go

Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.

Closed 8 years ago.

Improve this question

I have a site with a log-in and a contact module, which is sliding out from the top-left side of the page. I have only one problem: the log-in module is working fine, but the contact module is going underneath the text, rather than above it. I set z-index: 999999; but, it still isn't working. I'm using position: fixed;


Moving #iUngicontactForm from the table to the body tag will fix it. The problem is that the z-index of an element is inherited from it's parent and it only applies to sibling elements. And as you're using fixed positioning, it's a quick fix.

So instead of something like this:

<body>
   <table>
     <tr><td>some content..</td></tr>
     <tr><td><div id="iUngicontactForm"></div></td></tr>
    </table>
</body>

do this:

<body>
   <div id="iUngicontactForm"></div>
   <table>
     <tr><td>some content..</td></tr>
    </table>
</body>


if you go up the dom tree until .art-block and set z-index there it fixes the problem. Confirmed in firebug. Not to the whole .art-block class but you'll need to add a new class there, or id, or inline -- to that specific .art-block.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜