Z-index不工作 [英] Z-index not working

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

问题描述

查看我正在处理的此页面: http://s361608839.websitehome.co .uk / textcube /



导航条在滑块后面,我想要它坐在上面。我尝试在#navbar和#navbar-inner上设置高z索引,没有发生任何事。

  #navbar { 
background:url(../ images / nav-bg.png)repeat-x;
height:55px;
margin:0;
padding:0;
z-index:9999;
}
#navbar-inner {
宽度:912px;
margin:0 auto;
position:relative;
z-index:9999;
}



我认为javascript滑块使用CSS样式.bx-window和.bx-窗口是原因,但我已经设置了一个低Z-索引两者,但我没有看到任何差异。



帮助这将肯定是适当的。 p>

干杯

解决方案

z-index 仅适用于定位元素( position:absolute position:relative )。

这里是一篇文章 http:/ /www.w3.org/TR/CSS2/visuren.html#z-index



在您的情况下,您忘记添加 position 到您的元素之一。


Take a look at this page I'm working on: http://s361608839.websitehome.co.uk/textcube/

The nav bar is going behind the slider and I wanted it to sit above instead. I've tried setting a high z-index on the #navbar and #navbar-inner and nothing happened.

#navbar{
background: url(../images/nav-bg.png) repeat-x;
height: 55px;
margin: 0;
padding: 0;
z-index: 9999;
}
#navbar-inner{
width: 912px;
margin: 0 auto;
position: relative;
z-index: 9999;
}

I think the javascript slider using CSS style .bx-window and .bx-window are the cause however I have set a low z-index on both, yet I don't see any difference.

Help with this would definately be appeciated.

Cheers

解决方案

z-index works only with positioned elements (position:absolute, position:relative).

Here's an article http://www.w3.org/TR/CSS2/visuren.html#z-index

In your case, you forgot to add position to one of your element.

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

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