英 [lain hait] 美 [la?n ha?t]

行高

JavaScriptのlineHeightプロパティ 構(gòu)文

機(jī)能:行間の距離 (行の高さ) を設(shè)定します。

構(gòu)文: Object.style.lineHeight=normal|number|length|%

JavaScriptのlineHeightプロパティ 例

<html>
<head>
<script type="text/javascript">
function changeLineHeight()
{
document.getElementById("div1").style.lineHeight="2";
}
</script>
</head>
<body>

<div id="div1">
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
</div>
<br />
<input type="button" onclick="changeLineHeight()"
value="Change line-height" />

</body>
</html>

インスタンスの実行 ?

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