简体   繁体   English

CSS菜单ul ul li下拉菜单在7或6中不起作用,请帮助

[英]CSS menu ul ul li drop down menu not working in i.e 7 or 6 please help

I'm having issues with my drop down menu on ie 6/7 where it is dropping down behind other divs on my site: 我的6/7下拉菜单出现问题,它在我网站上其他div后面的下拉菜单:

http://www.bankruptcy.co.uk/ http://www.bankruptcy.co.uk/

I have fixed it in other browsers by using zindex. 我已经通过使用zindex在其他浏览器中修复了它。

Any help will be great thanks. 任何帮助将非常感谢。

Here is the menu code. 这是菜单代码。

// i cannot post the HTML becuase it has too many links in it. //我无法发布HTML,因为其中包含太多链接。

And here is the CSS. 这是CSS。

/* JS disabled styles */
nav li:hover ul { display:block; }

/* base nav styles */
nav {
    display:block;
    margin:0;
    position:relative;
    background-color:#1D1AB2;
    border-top-width: 1px;
    border-bottom-width: 3px;
    border-top-style: solid;
    border-bottom-style: solid;
    border-top-color: #222;
    border-bottom-color: #222;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    height: 35px;
}
nav ul {
    padding:0;
    margin:0;
    background-color: #1D1AB2;
}
nav li { position:relative; float:left; list-style-type:none;   z-index: 199;
}
.li80 {
    position:relative;
    float:left;
    width: 80px;
}
nav ul:after { content:"."; display:block; height:0; clear:both; visibility:hidden; }
nav li a {
    display:block;
    padding:10px 17px;
    border-left:1px solid #999;
    color:#FFFFFF;
    text-decoration:none;
    font-weight: bold;
}
nav li a:hover {
    color:#036;
    background-color: #FFD073;
}
nav li a:focus { outline:none; text-decoration:underline; }

/* base nav styles */
nav li:first-child a { border-left:none; }
nav li.last a { border-right:none; }
nav a span { display:block; float:right; margin-left:5px; }
nav ul ul {
    display:none;
    width:100%;
    position:absolute;
    left:0;
    background:#3333cc;
    z-index: 99;
}
nav ul ul li { float:none; }
nav ul ul a {
    padding:5px 10px;
    border-left:none;
    border-right:none;
    font-size:12px;
}

You can't use hover on li element in IE 6. 您不能在IE 6中的li元素上使用悬停。

There's some javascript resource below, that allows you to do that. 下面有一些javascript资源,您可以执行此操作。 Here's link.. include this script before css link and everything will be ok ;) 这是链接..在css链接之前包含此脚本,一切都会好的;)

http://ipkhakadze.com/resources/js/menu.htc http://ipkhakadze.com/resources/js/menu.htc

CSS :after property isn't recognized in IE6/7. IE6 / 7 无法识别 CSS :after属性。 I'm afraid you need to figure out an other solution for that. 恐怕您需要为此找到其他解决方案。

I see you already have the "hover on other elements" working, so try this 我看到您已经在“将鼠标悬停在其他元素上”了,所以尝试一下

remove position: relative from 移除 position: relative

nav li { 
   position:relative; float:left; list-style-type:none;   z-index: 199;
}

and add a new rule below it: 并在下面添加新规则:

nav li:hover {
 position: relative;
}

does that help? 有帮助吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM