HTML DOM fontStretch-eigenschap
Definitie en gebruik
De fontStretch-eigenschap wordt gebruikt om de huidige font-family te verstellen en te vervormen.
Syntaxis:
Object.style.fontStretch=waarde
mogelijke waarden
waarde | beschrijving |
---|---|
normal | Default value. Set the scaling ratio to standard. |
wider | Set the expand ratio to an even more expand value |
narrower | Set the shrink ratio to an even more shrink value |
|
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>