Latest web development tutorials
 

Style fontSizeAdjust Property

< Style Object

Example

Adjust font size:

document.getElementById("myP").style.fontSizeAdjust = "0.58";
Try it Yourself »

Definition and Usage

The fontSizeAdjust property sets or returns the font aspect value of a text.

All fonts have an aspect value which is the size-difference between the lowercase letter "x" and the uppercase letter "X".

The fontSizeAdjust property gives you better control of the font size when the first-choice font is not available. When a font is not available, the browser uses the second specified font. This could result in a big change for the font size. To prevent this, use this property.

When the browser knows the aspect value for the first choice-font, the browser can figure out what font-size to use when displaying text with the second-choice font.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The fontSizeAdjust property is only supported in Firefox.


Syntax

Return the fontSizeAdjust property:

object.style.fontSizeAdjust

Set the fontSizeAdjust property:

object.style.fontSizeAdjust="none|number|initial|inherit"

Value Description
none Default value. No font size adjustment
number Preserve the first-choice font's x-height, and calculate the aspect value ratio for the font.

The formula that is used: font-size of first-choice font*(aspect value of first-choice font/aspect value of available font)=font-size to use on available font

Example: If 14px Verdana (aspect value of 0.58) was unavailable, but the available font, Times New Roman, has an aspect value of 0.46, the adjusted font-size to use would be 14*(0.58/0.46) = 17.65px.
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

Technical Details

Default Value: none
Return Value: A String, representing the font aspect value of a text
CSS Version CSS3

Related Pages

CSS tutorial: CSS Font

CSS reference: font-size property

HTML DOM reference: font property


< Style Object