vertical-align
Definition
The vertical-align property specifies the vertical positioning of content inside inline elements and inside table cells.
Example
th {vertical-align: bottom}
Characteristics
Possible values for inline elements
baseline- Align the baseline of the element with the baseline of the parent element.
sub- Set the baseline of the element lower than the baseline of the parent element, to give the effect of subscript.
super- Set the baseline of the element higher than the baseline of the parent element, to give the effect of superscript.
text-top- The top of the element will be aligned with the top of the parent element.
text-bottom- The bottom of the element will be aligned with the bottom of the parent element.
top- The top of the element and its descendants will be aligned with the top of the line.
middle- The vertical midpoint of the element will be aligned with the baseline of the parent element plus half the height of lowercase letters.
bottom- The bottom of the element and its descendants will be aligned with the bottom of the line.
- length
- Raise (positive value) or lower (negative value) the box by this distance. The value
0cm means the same as baseline. - percentage
- Raise (positive value) or lower (negative value) the box by this distance (a percentage of the line-height value). The value
0% means the same as baseline. inherit- Use the same computed value as the parent element for this property.
Possible values for table cells
top- The table cell will be aligned to the top of the row.
middle- The table cell will be aligned to the middle of the row.
bottom- The table cell will be aligned to the bottom of the row.
inherit- Use the same computed value as the parent element for this property.
Default value
baseline
Applies to
Inline elements plus th and td.
Inherited
No
See also