line-height

收藏:0   阅读:99

CSS line-height 属性

实例

Set the line height in percent:

p.small {line-height:90%}
p.big {line-height:200%}

属性定义及使用说明

设置以百分比计的行高:.

注意: 负值是不允许的

默认值: normal
继承: yes
版本: CSS1
JavaScript 语法: object.style.lineHeight="2"


浏览器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主流浏览器都支持line-height属性。

注意: IE7和更早的版本不支持"inherit"的值。IE8需要定义!DOCTYPE。IE9支持"inherit"。


属性值

描述
normal 默认。设置合理的行间距。
number 设置数字,此数字会与当前的字体尺寸相乘来设置行间距。
length 设置固定的行间距。
% 基于当前字体尺寸的百分比行间距。
inherit 规定应该从父元素继承 line-height 属性的值。

相关文章

CSS 教程: CSS Text

© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!