英 [f?nt stail]? ?美 [fɑnt sta?l]??
n.字形
javascript fontStyle屬性 語法
作用:設定字體的風格。
語法:Object.style.fontStyle=normal|italic|oblique
javascript fontStyle屬性 範例
<html> <head> <script type="text/javascript"> function setFontStyle() { document.getElementById("p1").style.fontStyle="italic"; } </script> </head> <body> <p id="p1">This is an example paragraph.</p> <input type="button" onclick="setFontStyle()" value="Change font-style" /> </body> </html>
執(zhí)行實例 ?
點擊 "執(zhí)行實例" 按鈕查看線上實例