lineHeight 屬性設(shè)置行之間的距離(行高)。
Object.style.lineHeight=normal|number|length|%
值 | 描述 |
---|---|
normal | 默認。設(shè)置合理的行間距。 |
number | 設(shè)置數(shù)字,此數(shù)字會與當前的字體尺寸相乘來設(shè)置行間距。 |
length | 設(shè)置固定的行間距。 |
% | 基于當前字體尺寸的百分比行間距。 |
本例改變行高:
<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>
如對本文有疑問,請?zhí)峤坏浇涣髡搲瑥V大熱心網(wǎng)友會為你解答??! 點擊進入論壇
Powered by 365建站網(wǎng) RSS地圖 HTML地圖
copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號