CSS font-size-adjust - Interactive CSS Lab | IconVault
Normalize x-height across font fallbacks with font-size-adjust. Live visual matcher with x-height bars and copyable CSS. Free, in your browser.
CSS font-size-adjust
Keep x-height consistent when fonts swap
Primary font (A)
Fallback font (B)
Slide the adjust value until the teal x-height bars line up: that is the value that keeps your fallback text the same readable size when the primary font fails to load.
A: primary fontx-height ~13.5px
Pack my box with five dozen liquor jugs. 0123456789
B: fallback fontx-height ~13.5px (adjust 0.481)
Pack my box with five dozen liquor jugs. 0123456789
Matched. The fallback keeps the same x-height, so text will not shrink or jump when fonts swap.
Copy the CSS
/* Primary font with a webfont that may fail to load */
.headline {
font-family: Georgia, Arial, sans-serif;
font-size: 28px;
font-size-adjust: 0.481; /* x-height forced to 13px, matching Georgia */
}
/* Newer keyword forms (Chrome 127+, Firefox) */
.headline {
font-size-adjust: from-font; /* use the primary font's own x-height */
}5 of 5 free copies left. Ratios shown are approximate and vary by platform.
About this tool
IconVault's CSS font-size-adjust lab shows why text seems to shrink when a webfont fails and a fallback takes over. Pick a primary font and a fallback, slide the font-size-adjust value, and watch the teal x-height bars line up: when they match, the fallback renders at the same readable size as the original. The one-click Match button computes the right value from real font metrics. It is free and runs fully in your browser.
Different fonts have different x-heights at the same font size, so a fallback like Arial can look noticeably smaller than the Georgia it replaced, shifting your layout and hurting CLS. Setting font-size-adjust tells the browser to scale the fallback so its x-height equals a fixed fraction of the font size, keeping text legible and layouts stable. The lab explains numeric values and the newer from-font keyword, shows the generated CSS for your exact pairing, and notes that the built-in ratios are approximate and vary by platform.
Frequently asked questions
Popular searches
More tools
Algorithm Visualizer
Watch sorting and searching animate step by step
Alt Text Helper
Write better image alt text with live feedback
ARIA Reference
Searchable ARIA roles and attributes guide
Array Visualizer
Step through map, filter, reduce like a debugger
Coming soon
CLI
Coming soon
Figma plugin
Coming soon
VS Code extension
Coming soon
Chrome extension
Coming soon
AI icon generator
Coming soon
Team workspaces
Coming soon