CSS vertical-align property
Usage
Specifies the vertical alignment of an inline element in relation to the surrounding text.
Values
- baseline - default; the inline element will be positioned along the baseline of the current element
- top - aligns with the top of the line
- text-top - aligns with the top of the text
- middle - aligns with the middle of the text
- bottom - aligns with the bottom of the element
- text-bottom - aligns with the bottom of the text
- sub - lowers the baseline to subscript
- super - raises the baseline to superscript
- [length] offsets the baseline by a specified amount. Positive values raise the baseline, negative values lower it
- [percentage] - raises of lowers the baseline by a percentage of the line height
Example
Code:
span {
vertical-align: text-top;
}