property
vertical-align — CSS reference
Aligns inline-level boxes in a line or table cells in their row. Initial baseline, not inherited. Middle on an inline box is relative to the baseline and x-height, not parent height. It does not center arbitrary blocks.
Formal Syntax & Structure
css syntaxcss
baseline | sub | super | text-top | text-bottom | middle | top | bottom | <length-percentage> (classic values)Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS text lab</title><style>body {margin:0} .sample {background:#dcebe9;color:#182e32}
#a{vertical-align:middle}</style><body><p>Baseline <span id="a" style="display:inline-block;width:20px;height:20px;background:teal"></span> text</p></body></html>