div and vertical align

Discussion in 'HTML' started by Tobias Müller, Nov 25, 2003.

  1. Hi,

    doesn't "div" supports vertical align?

    <div class="text">Hello World</div>


    ..text {
    height: 100px;
    vertical-align: bottom;

    doens't work. Any hints?

    Regards from Germany
    Tobias Müller, Nov 25, 2003
    1. Advertisements

  2. The vertical-align property (which is CSS, not HTML) applies to inline
    elements and table cell elements only. By default, a div element is a block
    Jukka K. Korpela, Nov 25, 2003
    1. Advertisements

  3. Tobias Müller

    Steve Pugh Guest

    No. Nor does any other block level element. Look it up in the CSS spec
    - http://www.w3.org/TR/CSS2/visudet.html#propdef-vertical-align

    "Applies to: inline-level and 'table-cell' elements"
    Use padding and/or line-height. Or if IE is not required to support
    this part of the presentation use display: table-cell along with

    Steve Pugh, Nov 25, 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.