vertical-align and div

Discussion in 'HTML' started by Jochen Fuhrmann, Oct 6, 2003.

  1. hi, why doesn't the vertical-align work here:

    div.test {top:10px;
    left:10px;
    width:230px;
    height:90px;
    text-align:center;
    vertical-align:middle;}

    i want to put the text in the center of the block

    jochen
     
    Jochen Fuhrmann, Oct 6, 2003
    #1
    1. Advertisements

  2. Jochen Fuhrmann

    Steve Pugh Guest

    Are you specifying position somewhere else? top and left only apply
    when an element has a position value other than static (the default).
    Because vertical-align only applies in two cases -
    1. inline elements where it aligns the element relative to the
    surrounding line of text
    2. table cell elements where it aligns the content relative to the
    cell

    It does not apply to block level elements.

    http://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align

    http://www.aspekt1.net/ms/dev/vertical-align.html

    Steve
     
    Steve Pugh, Oct 6, 2003
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.