Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

  1.  permalink
    I have a navigation bar:

    <div id="navigation">item 1 | item2 | item 3</div>

    Here's the CSS for it:

    #navigation {
    background: url(../_images/navigation_background.gif);
    font-size: 0.7em;
    font-weight: bold;
    color: #FFF;
    height: 34px;
    text-align: center;
    vertical-align: middle;
    }

    I'm trying to get the text to sit in the middle vertically but it won't work. Is there something I'm doing wrong?

    Thanks.
    • CommentAuthorvarland
    • CommentTimeMay 24th 2007
     permalink
    To do it without any extra markup, which is not a very good idea (you should use a list), you need to set the line-height property the same as the height property. You can forget about the vertical-align property (as far as this is concerned).
    • CommentAuthordavist11
    • CommentTimeMay 24th 2007
     permalink

    The vertical-align property only works on tables.

    •  
      CommentAuthorjernigani
    • CommentTimeMay 25th 2007
     permalink
    Start with this :D

    You should search for horizontal css menus. There are alot of good articles about how to do this technique.

    ul li{
    display:inline;
    }
    <ul><li>item 1</li><li>item2</li></ul>
    •  
      CommentAuthorMatheus
    • CommentTimeMay 25th 2007
     permalink
    don't use vertical align
    try making it with padding
    • CommentAuthoralias
    • CommentTimeJun 4th 2007
     permalink
    vertical-align will work only if you set the display of the element to table-cell. but still, it won't work on IE6<. so it's whether you use a table where you want your content to be vertically aligned or try to achieve it using paddings / margins / line-heights.

    regards,
    Martin Saulis
Add your comments
    Username Password
  • Format comments as (Help)