HTML DOM fontStyle ÊôÐÔ
¶¨ÒåºÍÓ÷¨
fontStyle ÊôÐÔÉèÖÃ×ÖÌåµÄ·ç¸ñ¡£
Óï·¨£º
Object.style.fontStyle=normal|italic|oblique
¿ÉÄܵÄÖµ
Öµ | ÃèÊö |
---|---|
normal | ĬÈÏ¡£ä¯ÀÀÆ÷ÏÔʾһ¸ö±ê×¼µÄ×ÖÌå¡£ |
italic | ä¯ÀÀÆ÷»áÏÔʾһ¸öбÌåµÄ×ÖÌå¡£ |
oblique | ä¯ÀÀÆ÷»áÏÔʾһ¸öÇãбµÄ×ÖÌå¡£ |
ʵÀý
±¾ÀýÏòÎı¾Ìí¼ÓбÌåÑùʽ£º
<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>