z-index不工作? [英] z-index doesn't work?

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

问题描述

我使用jQuery做一个div apear,当我点击一个按钮 - >背景应该得到一个0.8的不透明度,出现的div将允许用户让他登录 - everythings好吧,当我不使用z -index,但我有4个div(标题,内容,页脚和div与login-Form)标题必须具有z-index:3和内容z-index:2 - 否则阴影将无法正常工作。 / p>

使用jQuery我添加一个div后的body标签,其中包含完整边 - 所以我可以设置不透明度,但是我必须设置表单的Z-索引-div高于一个为不透明的div - 但它不工作。 form-div的z-index是999,其他div有5



任何解决方法或z-index的东西?

  position:relative;更改位置。 


I use jQuery to make a div apear, when i click onto a button -> the background should get a opacity of 0.8 and the appeared div will allow the user to let him login - everythings alright when i don't use z-index, but i have 4 divs (header, content, footer, and the div with login-Form) header must have z-index:3 and content z-index:2 - otherwise the shadows won't work as expected.

With jQuery i add a div after the body tag which contains the full side - so i can set the opacity, but then i have to set the z-index for the form-div higher than the one for the div with opacity - but it doesn't work. z-index of the form-div is 999, the other div has 5

Any workarounds or something for z-index?

解决方案

Change the position of the element.

position: relative;

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

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