font
英[f?nt]? ?美[fɑ:nt]??
n.字體;字形;聖洗池(設(shè)為教堂中,常為石造);(同字號和字號的)一副鉛字
複數(shù): fonts
variant
英[?ve?ri?nt]? ?美[?veri?nt]??
##n.(詞等的)變體,(字音的)轉(zhuǎn)訌;[生]變種,變異體;變形,變量,轉(zhuǎn)化;[統(tǒng)]變式
adj.變異的;不同的,相異的,不一致的;多樣的;易變的,不定的
複數(shù): variants
javascript fontVariant屬性 語法
作用:設(shè)定小型大寫字母的字體顯示文字
語法:Object.style.fontVariant=normal|small-caps
javascript fontVariant屬性 範(fàn)例
<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>
執(zhí)行實例 ?
點擊 "執(zhí)行實例" 按鈕查看線上實例