lineHeight 属性设置行之间的距离(行高)。
</>code
- Object.style.lineHeight=normal|number|length|%
值 | 描述 |
---|---|
normal | 默认。设置合理的行间距。 |
number | 设置数字,此数字会与当前的字体尺寸相乘来设置行间距。 |
length | 设置固定的行间距。 |
% | 基于当前字体尺寸的百分比行间距。 |
本例改变行高:
</>code
- <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>
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛
Powered by 365建站网 RSS地图 HTML地图
copyright © 2013-2024 版权所有 鄂ICP备17013400号