O'Reilly logo

CSS Pocket Reference, 4th Edition by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

vertical-align

Values:

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

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, same as declared value

Description:

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. When applied to table cells, only the values baseline, top, middle, and bottom are recognized.

Examples:

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required