Search code examples
htmlcssinternet-explorerinternet-explorer-6

Simple navigation bar not working in IE6?


I've made a horizontal navigation bar to go on my website and it's not displaying correctly in IE6.

It's a really simple navigation bar and I'm not aware 100% what works and what doesn't in IE6.

Can anyone see anything wrong with my CSS?

Thanks

HTML:

<div id="controlslider">
    <ul>
        <li><a href="#slider2">Work, Life: Balanced.</a></li>
        <li><a href="#slider3">Mobilise your workforce.</a></li>
        <li><a href="#slider4">Built for business.</a></li>
        <li><a href="#slider5">Work whenever, wherever.</a></li>
        <li><a href="#slider6">Where to buy.</a></li>
    </ul>
</div>

CSS:

#controlslider{
    width: 981px;
    height: 50px;
    background: url(http://s361608839.websitehome.co.uk/images/respmod_menu.gif) no-repeat;
    margin: 0 auto;
    padding: 0;
    text-align: left;
    margin-top: -25px;
    list-style: none;
    overflow: hidden;
}
#controlslider ul{
    list-style: none;
    display: block;
    margin-left: -36px;
    margin-top: 0;
    list-style-type: none;
}
#controlslider li{
display: inline-block !important;
padding: 5px 0px 0 0;
width: 190px;
height: 35px;
position: relative;
overflow: hidden;
}
#controlslider li a{
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color : white;
    text-decoration: none;
    display: block !important;
    width: 190px;
    height: 35px;
    text-align: center;
    padding-top: 10px;
}
#controlslider li a:hover{
    background: url(http://s361608839.websitehome.co.uk/images/respmod_menu_button.png);
    width: 190px;
    height: 35px;
}

Solution

  • Try block and float instead of inline-block.

    #controlslider li{
       display: block !important;
       float: left;
       padding: 5px 0px 0 0;
       width: 190px;
       height: 35px;
       position: relative;
       overflow: hidden;
    }
    

    Be sure to clear floating after the UL.