Eg.
1234<span style="vertical-align: middle">567</span>890
Will render with 567
slightly below the surrounding numbers.
Eg.
1234<span style="vertical-align: middle">567</span>890
Will render with 567
slightly below the surrounding numbers.
It's because text has, by default,
vertical-align: baseline
. Middle's slightly lower than baseline.As mentioned by others, elements have a
vertical-align
ofbaseline
by default.In regards to why
middle
is lower thanbaseline
, MDN says the following:Since the height of the font text is greater than that of lowercase letters, the text becomes slightly lower.