|
1
% 基于当前字体尺寸的百分比行间距。
|
|
yjxjnOct 26, 2016
2
当前字体尺寸。
|
|
3
|
|
4
从来没用过 line-height 的 100%
|
|
5
<percentage>
Relative to the font size of the element itself. The computed value is this percentage multiplied by the element's computed font size. Percentage and em values may have unexpected results, see "Notes" section. 已经很清楚了 |
|
6
尽量用 1 ,而不是 100%,因为设定 line-height 会影响到设定元素的子元素, 100%是根据父元素字体计算出尺寸子元素继承,而 1 是根据子元素字体计算出尺寸子元素继承,所以根据百分比设定的时候很有可能得不到自己真正想要的尺寸
|
|
7
@ianva 我其实想设置不定高度的垂直居中...最后还是通过计算等到高度给 line-height 设置固定的值
|