英 [f?nt stail]? ?美 [fɑnt sta?l]??

n.字形

javascript fontStyle屬性 語法

作用:設(shè)定字體的風(fēng)格。

語法:Object.style.fontStyle=normal|italic|oblique

javascript fontStyle屬性 範(fàn)例

<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í)行實(shí)例 ?

點(diǎn)擊 "執(zhí)行實(shí)例" 按鈕查看線上實(shí)例