设置Z索引不工作。容器后面的按钮(HTML - CSS) [英] set Z index not working. button behind a container (HTML - CSS)
问题描述
我使用Metro css(windows 8风格)和有一个问题。
我有容器的警报(图片中的蓝色),
及以上,有'IT -CENTER',如果我点击那里,它打开一个按钮。
容器后面的按钮的问题..
我尝试设置容器的Z索引为-1,这是没有帮助。
I using Metro css (windows 8 style) and have a problem. I have container with alerts (the blue in the picture) , and above , there is 'IT -CENTER ' , If I click there it open a button. the problem that the button behind the container.. I try to set the Z index of the container to -1 , and it's not help.
带有按钮的下拉列表(IT中心):
IT中心
the dropdownlist with the button(IT-CENTER): IT-CENTER
<li style="z-index:3"><a href="Login.aspx">התנתק</a></li>
</ul>
</div>
和容器(蓝色):
<div id="alerts-container" style="z-index:-1">
<div id="toast-example1" class="toast toasttext02 fade in">
<button type="button" class="close" data-dismiss="alert"></button>
<div class="pull-left">
<div class="toast-object icon-info-4"></div>
</div>
<div class="toast-body" style="text-align:right">
(没有结束标签..)
我该怎么办?
谢谢!
推荐答案
-
如果您要设置
z-index
,则必须设置position:relative
-
You must set
position:relative
if you are settingz-index
- it is very important thing and can lead to your bug
如果1方法不能帮助您尝试设置 z -index
到该按钮的可能父项(可以肯定我看不到您的代码)
If the 1 method doesn't help you should try to set z-index
es to the possible parents of that button (can say for sure I don't see your code)
这篇关于设置Z索引不工作。容器后面的按钮(HTML - CSS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!