Hai*_*vgi 34
可能的值
号码:
设置将与当前字体大小相乘的数字,以设置线条之间的距离
长度 :
设置线之间的固定距离
%:
以当前字体大小的%为单位设置行之间的距离
来自http://www.w3schools.com/css/pr_dim_line-height.asp
属性line-height可以接受无单位数值.您也可以给出行高联合值,但通常不应该.但无单位的数字对于这个属性来说还不错.
另请注意:"1"不等于"normal" - 1与字体大小完全相同,因此多行元素(如段落)中的行将相互贴合,而正常情况下会增加线之间的预期间距.
使用字体速记:
font: font-style font-variant font-weight font-size/line-height font-family;
Run Code Online (Sandbox Code Playgroud)
如果未指定,则将line-height默认为normal.例如:
body{
line-height:1; /* as seen in Eric Meyer's reset css */
}
p{
font:normal normal normal 14px "Times New Roman", Times, serif;
}
Run Code Online (Sandbox Code Playgroud)
将导致所有段落具有正常的行高,覆盖身体的1集,而
p{
font:normal normal normal 14px/1 "Times New Roman", Times, serif;
}
Run Code Online (Sandbox Code Playgroud)
将保留行高1(在此示例中为14px).