我试图让我的页脚显示在页脚背景之上,但是z-index似乎没有工作.有人看到有什么问题吗?
http://jsfiddle.net/f2ySC/
解决方法
@H_502_5@ 你必须明确定义position属性:.footerBox { background-color: #FFFFFF; border: 10px solid #DDDDDD; margin: 10px 0 -200px -10px; width: 1185px; z-index: 1000; position:relative; }
这使得页脚进入当前的堆叠环境:
… The root element forms the root stacking context. Other stacking
contexts are generated by any positioned element (including relatively
positioned elements) having a computed value of ‘z-index’ other than
‘auto’. Stacking contexts are not necessarily related to containing
blocks. In future levels of CSS,other properties may introduce
stacking contexts,for example ‘opacity’ …