Create Menu with css and li elements compatible for all browsers.

Posted by Cesar Lopez on Stack Overflow See other posts from Stack Overflow or by Cesar Lopez
Published on 2010-05-21T16:03:53Z Indexed on 2010/05/21 16:10 UTC
Read the original article Hit count: 287

Filed under:
|
|
|

Hi all, I am trying to create a simple menu using li elements, but it only works on IE7, in FF and Chrome, the alignment get weird. Also the :hover and :Active only works on IE7.

Could anybody give me a hit on this?

I would really appreciate it.

CSS:

#heading{
    width: 700px;
   height:auto; 
    margin: 0 auto;
    background-color:#FFFFFF;
    margin-top:5px;
    margin-bottom:5px;
    display:block;
}
#imglogo{
 float:left;

}

#barDescription{
    float:right;

}



#navigation{
    text-align: right;
    margin-top: 70px;
}

#navigation li{
    float: right;
    display: block;
    text-align: center;
    list-style-type: none;  
}
#navigation li a{

    color:#A08019;
    background-image: url('Images/Menu1.png');
    background-repeat:repeat-x;
    background-position: center center;
        text-decoration:none;   
        font-weight:bold;
    display: block;
    height:25px;
    vertical-align:middle;
        padding-right:10px;
        padding-left:10px;
}

HTML:

<div id="heading" >
    <div id="imglogo">
        <img id="logo" src="Images/logo.png" alt="logo" />
    </div>
    <div id="barDescription">
       <h4>Especialidad en tapas,vinos y menus</h4>
       <h5>Restaurante de cocina creativa tradicional. Vinos y tapas</h5>
    </div>

    <ul id="navigation">
       <li><a href="#">Contacto</a></li>
       <li><a href="#">Ubicacion</a></li>
       <li><a href="#">Reservas</a></li>
       <li><a href="#">Menus</a></li>
       <li><a href="#">Local</a></li>
    </ul>

    </div>

© Stack Overflow or respective owner

Related posts about html

Related posts about css