如何解决这个IE7下拉菜单问题?

时间:2010-10-29 23:31:53

标签: css internet-explorer-7

这是我创建的下拉菜单的CSS,问题是只要我将鼠标项目悬停,菜单就会消失。

它被修复如果我设置高度:30px和行高:30px但我不想调整高度。我希望它能自动调整。我不能让它在IE7中工作。这是我的CSS

#menu {
    display: block;
    width: 1000px;
    height: 30px;
    background: url(../images/modern/menu.png) no-repeat;
    margin: 10px 0 0 0;
    position: relative;
    z-index: 10;
}

#menu ul {
    float: left;
    margin: 0 0 0 5px;
    display: inline;
    width: 795px;
}

#menu ul li {
    position: relative;
    float: left;
    display: block;
    position: relative;
}

#menu ul li a {
    float: left;
    display: block;
    color: #fff;
    font-weight: bold;
    padding: 9px 10px 9px 10px;
    background: url(../images/modern/menu_l.png) no-repeat right;
}

/* sub menu style */
#menu ul ul {
    padding:0;margin:0;border:none;
    float: none;
    display: none;
    position: absolute;
    z-index: 10;
    width: 190px;
    top: 29px;
    left: 0;
}
#menu ul ul ul {
    top: 0;
    left: 190px;
}

#menu ul ul li {
    float: none;
    display: block;
    position: relative;
}

#menu ul ul li a {
    padding:0;margin:0;border:none;
    float: none;
    display: block;
    font-weight: bold;
    position: static;
    background: none;
    color: #fff;
    padding: 6px 10px 6px 10px;
    background: #333;
    border-bottom: 1px solid #444;
}

这修复了它,但我真的不想为子项设置高度:

#menu ul ul li a {
    padding:0;margin:0;border:none;
    float: none;
    display: block;
    font-weight: bold;
    position: static;
    background: none;
    color: #fff;
    padding: 6px 10px 6px 10px;
    background: #333;
    border-bottom: 1px solid #444;
    height: 30px;
    line-height: 30px;
}

1 个答案:

答案 0 :(得分:1)

尝试zoom:1;到你申请height:30px;的内容。

相关问题