下拉导航无法工作,即7?

时间:2012-04-02 06:37:21

标签: html css internet-explorer drop-down-menu

我在css中制作了一个新的下拉导航。

Chrome,firefox,safari运行良好,但IE7没有显示下拉。

css

.cl{clear:both;}
#navi{
    background:#0082c8;
    position:relative;
    margin-top:15px;
}
#navi:after{
    position:absolute;
    content:"";
    left:0;
    right:0;
    top:0;
    height:5px;
    background:#00a7ff;
    border-top:1px solid #0285cb;
    border-bottom:2px solid #0068a6;
    box-shadow:inset 0 0 0 1px #26c6f8;
}

#navi:before{
    position:absolute;
    content:"";
    left:0;
    right:0;
    bottom:0;
    height:5px;
    background:#00a7ff;
    border-top:1px solid #0285cb;
    border-bottom:2px solid #0068a6;
    box-shadow:inset 0 0 0 1px #26c6f8;
}


#navi > li{
    float:left;
    margin:0 10px;
    position:relative;
    padding:14px 0;
}

#navi li a, .subnavi li a{
    color:white;
    text-decoration:none;
    display:inline-block;
    line-height:29px;
    padding:0 13px;
    font-size:16px;
    font-family:arial;
    text-shadow: 0px 2px 2px #034e9f;
    filter: dropshadow(color=#034e9f, offx=0, offy=2); 
}

#navi > li:hover > a, li:hover > a , #navi li a.active{
    background:#055c9f;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px; 
    -webkit-box-shadow: inset 0px 3px 3px 0px #042960;
    -moz-box-shadow: inset 0px 3px 3px 0px #042960;
    box-shadow: inset 0px 3px 3px 0px #042960;
    border:1px solid #009ada; 
    color:#f7cf00;
    line-height:27px;
    padding:0 12px;               
}

.subnavi{
    position:absolute;
    display:none;
    top:51px;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px; 
    -webkit-box-shadow: 0px 0px 3px 1px #979395;
    -moz-box-shadow: 0px 0px 3px 1px #979395;
    box-shadow: 0px 0px 3px 1px #979395; 
    background:#0082c8;
    border:1px solid #005890;
    padding:10px 0;
    white-space:nowrap;
}

#navi li:hover .subnavi{
    display:block;

}
#navi .subnavi li{
    margin:0;
}
#navi .subnavi li a{
    display:block;
    font-size:13px;
    padding:0 15px;
    border-radius:0;
    line-height:27px;
}
#navi .subnavi li a:hover{
    padding:0 15px;
    border-radius:0;
    border-left:0;
    border-right:0;
    line-height:25px;
}


​

HTML

<ul id="navi">
    <li><a href="" class="active">About</a></li>
    <li><a href="">Services</a>
        <ul class="subnavi">
            <li><a href="">Web Development</a></li>
            <li><a href="">WordPress</a></li>
            <li><a href="">Graphic Design</a></li>
            <li><a href="">Icon Design</a></li>
            <li><a href="">Motion Graphics</a></li>    
        </ul>

    </li>
    <li><a href="">Works</a></li>

    <div class="cl"></div>
</ul>​

此处链接http://jsfiddle.net/rohitazad/3qPbE/11/

1 个答案:

答案 0 :(得分:0)

嗨这不是答案,但只是我个人的想法。

使用float:left;你可以试试display:inline-block;并为IE添加黑客:

缩放:1;
*显示:内联;

试试吧。如果它的工作尝试下次以后Disply:inline-block;