font-size-adjust
Baseline
2024
Newly available
Since July 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
The font-size-adjust attribute allows authors to specify an aspect value for an element that will preserve the x-height of the first choice font in a substitute font.
Note:
As a presentation attribute, font-size-adjust also has a CSS property counterpart: font-size-adjust. When both are specified, the CSS property takes priority.
You can use this attribute with the following SVG elements:
Example
Usage notes
| Default value | none |
|---|---|
| Value | none | <number> |
| Animatable | Yes |
none-
Choose the size of the font based only on the
font-sizeproperty. <number>-
Choose the size of the font so that its lowercase letters (as determined by the x-height of the font) are the specified number times the
font-size.The number specified should generally be the aspect ratio (ratio of x-height to font size) of the first choice
font-family. This means that the first-choice font, when available, will appear the same size in browsers, whether or not they supportfont-size-adjust.0yields text of zero height (hidden text).
Specifications
| Specification |
|---|
| CSS Fonts Module Level 4 # font-size-adjust-prop |
Browser compatibility
See also
- CSS
font-size-adjustproperty