z-index 和位置不起作用
我有这个页面: http://bable.co.il/static/index1.php ?page=safety&id=7
当您将鼠标悬停在文章上时,您将看到一个滑动菜单。 该菜单位于文章本身下方。 我尝试修复 z-index 和菜单的位置,但没有成功。
这是针对 explorer 8
我发布该链接是因为我认为您可以自己检查 css 并了解发生了什么。 无论如何,这是显示的 ul 的 css:
.topnav{
display: none;
position: absolute;
z-index: 10000;
border: 1px solid black;
}
这是菜单顶部元素的 css:
.ac_subitem{
width:90%;
right:6%;
position: relative;
margin-top:1px; /* animate to -200px */
/*background: transparent url(../images/tpl/bg_menu.png) repeat top left;*/
/* Fallback for web browsers that doesn't support RGBa */
background: rgb(0, 0, 0);
/* RGBa with 0.6 opacity */
background: rgba(0, 0, 0, 0.6);
/* For IE 5.5 - 7*/
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
/* For IE 8*/
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
}
有人可以帮忙吗?!!
I have this page:
http://bable.co.il/static/index1.php?page=safety&id=7
when you hover over articles, you will get a sliding menu.
this menu comes under the the article it self.
I tried to fix the z-index and the position of the menu with no success.
this is for explorer 8
I posted the link because I thought you could check the css by your self and figure what is going on.
anyway, here is the css of the ul that shows up:
.topnav{
display: none;
position: absolute;
z-index: 10000;
border: 1px solid black;
}
and here is the css of the element that comes on top of the menu:
.ac_subitem{
width:90%;
right:6%;
position: relative;
margin-top:1px; /* animate to -200px */
/*background: transparent url(../images/tpl/bg_menu.png) repeat top left;*/
/* Fallback for web browsers that doesn't support RGBa */
background: rgb(0, 0, 0);
/* RGBa with 0.6 opacity */
background: rgba(0, 0, 0, 0.6);
/* For IE 5.5 - 7*/
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
/* For IE 8*/
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
}
can anyone help please?!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您完全缺少页面中的 DOCTYPE,而该页面又以 Quirks 模式呈现它。添加正确的 DOCTYPE,它应该可以正常工作。
You're totally missing the DOCTYPE in your page which in turn is rendering it in Quirks Mode. Add a proper DOCTYPE and it should work ok.
<!DOCTYPE html>
要使用 z-index,您的 div 必须在 css 中绝对定位。你这样做了吗?
To use z-index your div has to be positioned absolute in your css. Did you do that?