p.small {line-height:90%}
p.big {line-height:200%}
设置以百分比计的行高:.
注意: 负值是不允许的
| 默认值: | normal |
|---|---|
| 继承: | yes |
| 版本: | CSS1 |
| JavaScript 语法: | object.style.lineHeight="2" |
![]()
![]()
![]()
![]()
![]()
所有主流浏览器都支持line-height属性。
注意: IE7和更早的版本不支持"inherit"的值。IE8需要定义!DOCTYPE。IE9支持"inherit"。
| 值 | 描述 |
|---|---|
| normal | 默认。设置合理的行间距。 |
| number | 设置数字,此数字会与当前的字体尺寸相乘来设置行间距。 |
| length | 设置固定的行间距。 |
| % | 基于当前字体尺寸的百分比行间距。 |
| inherit | 规定应该从父元素继承 line-height 属性的值。 |
CSS 教程: CSS Text