Easy Tutorial
❮ Prop Loc Hostname Met His Go ❯

verticalAlign Property


Definition and Usage

The verticalAlign property sets or returns the vertical alignment of the content within an element.

Syntax

Setting the verticalAlign property:

Returning the verticalAlign property:

Value Description
length Raises or lowers an element by a specified length. Negative values are allowed.
% Raises or lowers an element by a percentage of the "line-height" property. Negative values are allowed.
baseline Default. Aligns the baseline of the element with the baseline of the parent element.
sub Vertically aligns subscript text.
super Vertically aligns superscript text.
top Aligns the top of the element with the top of the tallest element in the line.
text-top Aligns the top of the element with the top of the parent element's font.
middle Places the element in the middle of the parent element.
bottom Aligns the bottom of the element with the bottom of the lowest element in the line.
text-bottom Aligns the bottom of the element with the bottom of the parent element's font.
inherit Specifies that the value of the verticalAlign property should be inherited from the parent element.

Browser Support

All major browsers support the verticalAlign property.

Note: IE7 and earlier versions do not support the "inherit" value. IE8 only supports "inherit" if !DOCTYPE is specified. IE9 supports "inherit".


Example

Change the vertical alignment of text in a table:

❮ Prop Loc Hostname Met His Go ❯