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;

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

    Jochen Fuhrmann, Oct 6, 2003
    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

    It does not apply to block level elements.

    Steve Pugh, Oct 6, 2003
    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.