Name

vertical-align

Values:

baseline | sub | super | top | text-top | middle | bottom | text-bottom | <percentage> | <length> | inherit

Initial value:

baseline

Applies to:

Inline elements and table cells.

Inherited:

No.

Percentages:

Refer to the value of line-height for the element.

Computed value:

For percentage and length values, the absolute length; otherwise, as specified.

Note:

When applied to table cells, only the values baseline, top, middle, and bottom are recognized.

Description:

This defines the vertical alignment of an inline element’s baseline with respect to the baseline of the line in which it resides. Negative length and percentage values are permitted, and they lower the element instead of raising it. In table cells, this property sets the alignment of the content of the cell within the cell box.

Examples:

sup {vertical-align: super;}
.fnote {vertical-align: 50%;}

Supported by:

Firefox, Internet Explorer, Opera, Safari.

Get CSS Pocket Reference, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.