HTML DOM fontVariant ÊôÐÔ
¶¨ÒåºÍÓ÷¨
fontVariant ÊôÐÔÓÃÓÚÉèÖÃСÐÍ´óд×ÖĸµÄ×ÖÌåÏÔʾÎı¾
Óï·¨£º
Object.style.fontVariant=normal|small-caps
¿ÉÄܵÄÖµ
Öµ | ÃèÊö |
---|---|
normal | ĬÈÏ¡£ä¯ÀÀÆ÷»áÏÔʾһ¸ö±ê×¼µÄ×ÖÌå¡£ |
small-caps | ä¯ÀÀÆ÷»áÏÔʾСÐÍ´óд×ÖĸµÄ×ÖÌå¡£ |
ʵÀý
±¾Àý°ÑµÚÒ»¶ÎÉèÖÃΪСÐÍ´óд×Öĸ£º
<html>
<head>
<script type="text/javascript">
function setSmallCaps()
{
document.getElementById("p1").style.fontVariant="small-caps";
}
</script>
</head>
<body>
<p id="p1">This is an example paragraph.</p>
<p>This is another example paragraph.</p>
<input type="button" onclick="setSmallCaps()"
value="Display small-caps font" />
</body>
</html>