HTML DOM Style fontSizeAdjust Property

## JavaScript Reference

Overview

## JavaScript Objects

JS Array JS Boolean JS Date JS Math JS Number JS String JS RegExp JS Global

## Browser Objects

Window Navigator Screen History Location

## HTML DOM Objects

DOM Document DOM Elements DOM Attributes DOM Events

## HTML Objects

DOM Anchor DOM Area DOM Base DOM Body DOM Button DOM Form DOM Frame/IFrame DOM Frameset DOM Image DOM Input Button DOM Input Checkbox DOM Input File DOM Input Hidden DOM Input Password DOM Input Radio DOM Input Reset DOM Input Submit DOM Input Text DOM Link DOM Meta DOM Object DOM Option DOM Select DOM Style DOM Table DOM td / th DOM tr DOM Textarea

# Style fontSizeAdjust Property

Style Object

## 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.

## Syntax

Set the fontSizeAdjust property:

Object.style.fontSizeAdjust="none|value|inherit"

Return the fontSizeAdjust property:

Object.style.fontSizeAdjust

Value | Description
--- | ---
none | Do not preserve x-height of first-choice font. This is default

value

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.

inherit | The value of the fontSizeAdjust property is inherited from parent element

## Browser Support

The fontSizeAdjust property is only supported in Firefox.

## Example

Adjust font size:

<html>
<head>
<script>
function displayResult()
{
document.getElementById("p1").style.fontSizeAdjust="0.58";
}
</script>
</head>
<body>
<p id="p1">This is some text.</p>
<br>
<button type="button" onclick="displayResult()">Adjust font size</button>
</body>
</html>
Try it yourself »

Style Object

## Your suggestion:

Your E-mail (optional):

Page address:

Description:

Close [X]

## Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

## WEB HOSTING

Best Web Hosting UK Reseller Hosting Wow! $5 SSD Hosting

## WEB BUILDING

Download XML Editor
FREE Website BUILDER FREE Website Creator

## WEB RESOURCES

Web Statistics Web Validation

## SHARE THIS PAGE