Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

CSS font-size-adjust property


May 05, 2021 CSS Reference Manual


Table of contents


Set the font-size-adjust property for different HTML elements:

h1
  {
  font-size-adjust:0.58;
  }

p
  {
  font-size-adjust:0.60;
  }

Give it a try yourself

Browser support

Internet Explorer does not support font-size-adjust properties.

Definitions and usages

The font-size-adjust property specifies an aspect value for an element so that you can maintain the x-height of the preferred font.

Description

The ratio between the height of the lowercase letter "x" and the height of "font-size" is called the aspect value of a font. W hen a font has a high aspect value, it is easier to read when it is set to a very small size. F or example, Verdana's aspect value is 0.58 (meaning that when the font size is 100px, its x-height is 58px). T imes New Roman has a aspect value of 0.46. This means Verdana is easier to read than Times New Roman at small sizes.

Default: none
Inheritance: yes
Version: CSS2
JavaScript syntax: object .style.fontSizeAdjust="0.70"

Possible values

Value Describe
none Default. If this font is not available, the x-height of this font is not maintained.
number

Defines the ratio of aspect values for fonts.

Formulas that can be used:

The font size of the preferred font is the font size (font-size-adjust value / aspect value of the available font) . . . the font size that can be applied to the available font

Example:

If Verdana of 14px (aspect value is 0.58) is not available, but the aspect value of an available font is 0.46, the size of the alternative font will be 14 x (0.58/0.46) x 17.65px.

TIY instance

Use font-size-adjust to set the font size
This example shows how to set the font size using font-size-adjust.

Related pages

CSS tutorial: CSS font

CSS Reference Manual: CSS font property

HTML DOM Reference Manual: FontSizeAdjust Properties