The vertical-align property can be used to set the vertical alignment for an inline element (such as span). The default value is "baseline", which aligns the baseline of the inline element box with the baseline of the parent box. The possible vertical-align values include the following keywords: baseline, sub, super, top, middle, bottom, text-top, and text-bottom. The sub value represents subscript, while the super value represents superscript. Note that the sub and super vertical-align values refer to the alignment of the text and do not influence the font size of the text. In addition, the vertical-align property can be set to inherit. Additionally, vertical-align can be set to lengths (such as 20px or 2em) and percentages (such as 100% or -50%).

The style-test.html file below gives examples of several vertical-align values, such as baseline, super, sub, percentages, and lengths. The first seven examples are span (inline) boxes within div (block) boxes, while the last example is a span within a span.