Example

A simple vertical-align property example:

Laboratory

description & Usage

To determine the vertical alignment of an element, we use the Vertical-align property.

Informations

# Description
Default Value baseline
Inherited no
Animatable yes
Version CSS1
JavaScript syntax object.style.verticalAlign="top"

Browser compatibility and Support

# Chrome Edge Firefox Safari Opera
Vertical-align

Syntax

Values

Values Description
baseline This value is aligned with the parent baseline and is the default.
sub This value is aligned with the subtitle baseline.
super This value is aligned with the parent baseline.
top This value is aligned with the topmost element of the line.
text-top This value aligns with the top of the parent element.
middle This value is aligned in the middle of the parent element.
bottom This value is aligned with the lowest element of the line.
text-bottom This value aligns with the bottom of the parent element.
initial Adds this value to its default property.
inherit It inherits this value from its parent tag.