简体   繁体   中英

CSS Drop down menu on Internet Explorer 7 bug

I have a CSS drop down menu built, that is working perfectly of course in Firefox and Chrome. But on Internet explorer 7 and 8, the drop down is moved to the right making it impossible to click the links.

I made a jsFiddle here : http://jsfiddle.net/xMrPE/

And a screenshot of it under ie7 here : http://s16.postimg.org/g90wthb2t/image.png

here is the HTML :

<div class="menu">
<ul>
    <li>
        <a href="#">La meunerie française</a>
        <ul>
            <li style="margin-left:0;"><a href="conseil.php">Conseil d'administration</a></li>
            <li style="margin-left:0;"><a href="syndicats.php">Syndicats régionaux</a></li>
            <li style="margin-left:0;"><a href="equipe.php">L'équipe</a></li>
        </ul>
    </li>
    <li>
        <a href="#">La filière</a>
        <ul>
            <li style="margin-left:0;"><a href="entites_analyse.php">Entités techniques de la meunerie</a></li>
            <li style="margin-left:0;"><a href="meunerie_europe.php">Meunerie européenne</a></li>
            <li style="margin-left:0;"><a href="horsue.php">Meunerie hors UE</a></li>
            <li style="margin-left:0;"><a href="organisations.php">Organisations professionnelles</a></li>
            <li style="margin-left:0;"><a href="intercereales.php">Intercéréales</a></li>
            <li style="margin-left:0;"><a href="franceagrimer.php">FranceAgriMer</a></li>
        </ul>
    </li>
    <li>
        <a href="#">Les Moulins</a>
        <ul>
            <li style="margin-left:0;"><a href="regions-meunieres.php">Régions meunières</a></li>
            <li style="margin-left:0;"><a href="regions-administratives.php">Régions administratives</a></li>
            <li style="margin-left:0;"><a href="farines.php?farine_id=">Farines & produits commercialisés</a></li>
            <li style="margin-left:0;"><a href="groupements.php">Groupements meuniers</a></li>
        </ul>
    </li>
    <li>
        <a href="#">Fournisseurs</a>
        <ul>
            <li style="margin-left:0;"><a href="fournisseurs-rubrique.php">Rubrique</a></li>
            <li style="margin-left:0;"><a href="fournisseurs-alphabetique.php">Liste Alphabétique</a></li>
        </ul>
    </li>
</ul>
</div>

The CSS :

.menu {
    width:100%;
    height:55px;
    float:left;
    position:relative;
    z-index: 1000;
    background-color: #5c4a29;
}

.menu ul {
    list-style: none;
    padding-top:7px;
    font-size: 11px;
}

.menu ul li {
    float:left;
    margin-left:55px;

}

.menu ul li a {
    color:#ffffff;
    padding-bottom:25px;
}

.menu ul li a:hover, .menu ul li a.actif, .menu ul li:hover > a{
    color:#DDD3AA;
}

.menu ul ul {
    display:none;
}



.menu ul li:hover > ul {
    display: block;
    position:absolute;
    z-index: 10000;
    width:210px;
    padding-bottom:20px;
    top:55px;
    -webkit-border-radius: 0px 10px 0px 10px;
    border-radius: 0px 10px 0px 10px;
    background-color: #5c4a29;
}

.menu ul ul li {
    width:190px;
    padding-left:10px;
    float: left;
    margin-top:10px;
}

.sidebar {
    width:225px;
    min-height:400px;
    float:left;
    position:relative;
}

I really can't see why it isn't working correctly.

Any help would be much appreciated. Thanks in advance !

Sébastien

For one on line 37 in your css I would change top from 55 to 45 so you can actually select the links. Also on line 1 change your height to 45.

.menu ul li:hover > ul {
display: block;
position:absolute;
z-index: 10000;
width:210px;
padding-bottom:20px;
top:45px;
-webkit-border-radius: 0px 10px 0px 10px;
border-radius: 0px 10px 0px 10px;
background-color: #5c4a29;
}

.menu {
width:100%;
height:55px;
float:left;
position:relative;
z-index: 1000;
background-color: #5c4a29;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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