HTML DOM fontStretch Property

Definition and Usage

The fontStretch property is used to stretch or distort the current font-family.

Syntax:

Object.style.fontStretch=value

possible values

value description
normal Default value. Set the scaling ratio to standard.
wider Set the expansion ratio to an even wider value
narrower Set the shrinkage ratio to an even narrower value
  • ultra-condensed
  • extra-condensed
  • condensed
  • semi-condensed
  • semi-expanded
  • expanded
  • extra-expanded
  • ultra-expanded

Set the scaling ratio of font-family.

"ultra-condensed" is the widest value, while "ultra-expanded" is the narrowest value.

Example

This example stretches the font:

<html>
<head>
<script type="text/javascript">
function setFontStretch()
{
document.getElementById("p1").style.fontStretch="ultra-expanded";
}
</script>
</head>
<body>
<p id="p1">This is an example paragraph.</p>
<input type="button" onclick="setFontStretch()" 
value="Stretch font" />
</body>
</html>

Try It Yourself (TIY)

fontStretch - Stretch Font