2013年9月12日 星期四

CSS筆記:Font

優化之道p.267, 268 FONT Family
serif, san-serif, monospace




優化之道p.267, 268 FONT Size
font-size自動會inherit
可用px, %, em設定
瀏覽器預設文字大小是16px
如果<h1>的font-size是2em, 那麼大小將會是2 * (<h1>所繼承的font-size大小) %亦是如此
h1 { line-height: 1.2em } means that the line height of "h1" elements will be 20% greater than the font size of the "h1" elements. On the other hand:
h1 { font-size: 1.2em } means that the font-size of "h1" elements will be 20% greater than the font size inherited by "h1" elements.
http://kyleschaeffer.com/development/css-font-size-em-vs-px-vs-pt-vs/
http://www.w3.org/Style/Examples/007/units.en.html




優化之道p.267, 268 line-height
行距(leading) = 此行文字的最低點到下一行文字的最高點之間的距離
line-height屬性設定了整行文字的高度,所以font-size和line-height之間的差異就是行距
增加line-height會使得文字行之間的垂直間距變大
http://www.mukispace.com/css-line-height/

沒有留言:

張貼留言