HTML Dog
Skip to navigation

CSS Property: vertical-align

The vertical alignment of an inline box or text, or table cell.

Possible Values

ValueDescriptionExample
[length]Raises (positive value) or lowers (negative value) the text/box. 0 is equal to the baseline.5px
[percentage]Raises (positive value) or lowers (negative value) the text/box. Calculated in relation to the line-height. 0% is equal to the baseline, 100% is one times the line-height, etc.10%
baselineAligns the baseline of the text/box with the baseline of its containing box. Default.
subLowers the baseline to subscript level.
superRaises the baseline to superscript level.
topAligns to the top of the line or table cell.
text-topAligns to the top of the text of the containing box.
middleAligns to the middle of the text of the containing box or to the middle of the table cell.
bottomAligns to the bottom of the line or table cell.
text-bottomAligns to the bottom of the text of the containing box.
inherit
initial
unset

Example


h2 em {
    font-size: 0.5em;
    vertical-align: text-top;
}

td { vertical-align: top; }

Browser support