IE7 z-index即使我添加位置也不起作用:absolute
或relative
还有其他解决方案吗?我添加其他div较低的z索引但不起作用
.gallery {
background-color: #F4F4F4;
display: block;
min-height: 300px;
padding: 20px 10px;
position: absolute;
right: -44px;
top: 70px;
width: 980px;
z-index: 3000;
display: none;
}
.sub_menu {
background-color: #F4F4F4;
float: left;
height: 21px;
padding: 40px 35px;
position: relative;
top: 10px;
width: 930px;
z-index: 1000;
}
答案 0 :(得分:1)
使用z-index
和IE时,有时需要使用!important
.gallery {
background-color: #F4F4F4;
display: block;
min-height: 300px;
padding: 20px 10px;
position: absolute;
right: -44px;
top: 70px;
width: 980px;
z-index: 3000 !important;
display: none;
}
.sub_menu {
background-color: #F4F4F4;
float: left;
height: 21px;
padding: 40px 35px;
position: relative;
top: 10px;
width: 930px;
z-index: 1000 !important;
}
答案 1 :(得分:0)
!important
应该用作最后的结果。
请先手动
body{
z-index: -1
}
.gallery {
background-color: #F4F4F4;
display: block;
min-height: 300px;
padding: 20px 10px;
position: absolute;
right: -44px;
top: 70px;
width: 980px;
z-index: 2;
display: none;
}
.sub_menu {
background-color: #F4F4F4;
float: left;
height: 21px;
padding: 40px 35px;
position: relative;
top: 10px;
width: 930px;
z-index: 1;
}