Vertical-align

The   property is used in CSS and certain HTML elements. It specifies the vertical alignment of an inline or table-cell element.

Values for inline elements

 * Most of the values vertically align the element relative to its parent element.


 * - Aligns the baseline of the element with the baseline of its parent.
 * - Aligns the baseline of the element with the subscript-baseline of its parent.
 * - Aligns the baseline of the element with the superscript-baseline of its parent.
 * - Aligns the top of the element with the top of the parent element's font.
 * - Aligns the bottom of the element with the bottom of the parent element's font.
 * - Aligns the middle of the element with the middle of lowercase letters in the parent.
 * - Aligns the baseline of the element at the given length above the baseline of its parent. Ex.,  , etc.
 * - Like values, with the percentage being a percent of the  property.

For elements that do not have a baseline, the bottom margin edge is used instead. However, two values vertically align the element relative to the entire line rather than relative to its parent.


 * - Aligns the top of the element and its descendants with the top of the entire line.
 * - Aligns the bottom of the element and its descendants with the bottom of the entire line.

Negative values are allowed for all values.

Values for table-cell elements

 * ,,  ,  ,  ,  , or   - Aligns the baseline of the cell with the baseline of all other cells in the row that are baseline-aligned.
 * - Aligns the top padding edge of the cell with the top of the row.
 * - Centers the padding box of the cell within the row.
 * - Aligns the bottom padding edge of the cell with the bottom of the row.

Negative values are allowed for all values.

HTML example:



CSS example:

img { vertical-align:bottom; }