CKTIS / CSS
font-variant-position — typographic subscripts and superscripts
The font-variant-position property selects subscript or superscript glyphs without shifting the text baseline. Its appearance depends on the font’s available glyphs and any synthesis performed by the browser.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
font-variant-position: normal | sub | super;font-variant-position selects typographic glyph variants: normal enables neither variant, sub requests subscripts (OpenType feature subs), and super requests superscripts (sups). Its initial value is normal; the property is inherited and applies to all elements and text.
Designed subscript and superscript glyphs fit within the same em box as ordinary glyphs. They require neither a font-size change nor a baseline shift, so glyph substitution itself does not increase line height. This differs from shrinking text and moving it with vertical-align.
A font may not contain every required variant. If glyphs are missing and synthesis is allowed, the specification requires synthesis across the entire contiguous text run to avoid mixing mismatched glyphs. Setting font-synthesis-position: none disables this synthesis, so missing glyphs alone do not necessarily trigger it. Appearance therefore depends on the font, synthesis settings, and implementation. The property is not cumulative: nested super does not create another superscript level.
The example retains the semantic sub and sup elements. Inside @supports, it resets their default shrinking and shifting to avoid a double effect; outside that block, ordinary browser formatting remains available. Syntax recognition by @supports does not prove glyph availability or correct rendering—the example requires local verification.
Examples
<!doctype html>
<meta charset="utf-8">
<title>font-variant-position</title>
<style>
p { font: 32px/1.5 serif; }
@supports (font-variant-position: sub) {
sub, sup {
font-size: 100%;
vertical-align: baseline;
line-height: inherit;
}
sub { font-variant-position: sub; }
sup { font-variant-position: super; }
}
</style>
<p>H<sub>2</sub>O; x<sup>2</sup></p>Result
H2O; x2
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.