JavaScriptのfontStyleプロパティ


  翻訳結果:

UK [fɔnt stail] US [fɑnt staɪl]

n.glyph

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>

インスタンスの実行 »

[インスタンスの実行] ボタンをクリックしてオンライン インスタンスを表示します

ホームページ

ビデオ

に質問