HTML DOM fontStretch 屬性
定義和用法
fontStretch 屬性用于對(duì)當(dāng)前的 font-family 進(jìn)行伸縮變形。
語法:
Object.style.fontStretch=value
可能的值
值 | 描述 |
---|---|
normal | 默認(rèn)值。把縮放比例設(shè)置為標(biāo)準(zhǔn)。 |
wider | 把伸展比例設(shè)置為更進(jìn)一步的伸展值 |
narrower | 把收縮比例設(shè)置為更進(jìn)一步的收縮值 |
|
設(shè)置 font-family 的縮放比例。 "ultra-condensed" 是最寬的值,而 "ultra-expanded" 是最窄的值。 |
實(shí)例
本例對(duì)字體進(jìn)行伸展:
<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>