tags:

views:

50

answers:

4

The elements aren't positioning themselves as I want them to. I want the picture to be 20px away from the left, why is the logos div so thin? :S Also why is the topuserbar div going under? There seems to be no reason. alt text

Here is the CSS and HTML. It's not rocket science, so that's extra frustrating because it shouldn't be rendering like this.

#header
{
    border:1px solid red;
    background-image: url('images/headerBackground.png');
    background-repeat:repeat;
    width:auto;    
}

#logo
{
    border:1px solid red;
    display:inline;
    margin-left:35px;
}

#topuserbar
{
    border:1px solid red;    
    font-family:Georgia;
    font-size:large;    
    float:right;
    margin-right:50px;
}

#topuserbar ul
{
}

#topuserbar li
{
    display:inline;
    margin-left:10px;
    color:#fff;
}

#topuserbar .helpicon
{
    margin:0;
    padding:0;
    position:relative;
    top:5px;   
    left:3px;
}

#topuserbar a
{
    color:#fff;
}

#topuserbar a:hover
{
    color:Yellow;
}

<body>    
    <div id="header">
        <div id="logo">
            <img src="../../Content/images/cumaviLogo.png" alt="Cumavi.com - Compras y ventas online en Bolivia!" />    
        </div>
        <div id="topuserbar">
            <ul>
                <li>Bienvenidos, <span class="userSalute">Sergio!</span></li>
                <li><a href="#" class="someClass" title="Ver una lista compeleta de todos tus anuncios.">Mis Anuncios</a></li>
                <li><a href="#" class="someClass" title="Ir a tu perfil para ver tus comentarios, tu ranking y mas!">Perfil</a></li>
                <li><a href="#" class="someClass" title="Tips y consejos de como mejor usar Cumavi.com y protogerte de enganos.">Ayuda</a><img class="helpicon" src="../../Content/images/helpIcon.png" alt="Help icon." width="20" height="20"/></li>
                <li><a href="#">Cerrar Sesion</a></li>
            </ul>
        </div>
    </div>
</body>

EDIT: What the heck? Opera and Firefox render things differently. I knew there were browser inconsistencies but for thing as simple as this?! Can a pro please let me know what's causing this? alt text

A: 

For the first question should this solve it:

#logo
{
    border:1px solid red;
    display:inline;
    margin-left:20px;
}

Im not sure if I understood you!

Trufa
Thanks for trying to help me but I'm more interested in finding out why Chrome pushes my div under for no reason whatsoever and Firefox acts as one would expect.
Serg
Its not for no reason... its because your logo div is displayed as an inline element and is forcing floated elements to float underneath it. Give your Logo element a width and float it left, chrome will stop pushing your menu below your logo.
Andy Groff
+1  A: 

I would give the header a specified height, take display:inline off of your logo div,and maybe make the logo div float:left;

Andy Groff
A: 

Try this:

#logo
{
    border:1px solid red;
    display:inline;
    margin-left:20px;
    height: 75px;
    width:140px
}

adjust the height and width to your liking...

cinqoTimo
+1  A: 

Got it:

This is how you stop to Chrome push your div under:

#topuserbar ul
{
    margin:0px;
}

Worked fine for me!

Tell me if it does what you want!

Trufa
@Sergio Tapia it was adding a huge margin! (18px)
Trufa