2013-01-06 17 views
1

我在嘗試理解進入以下CSS樣式的CSS計算過程。代碼來自一個響應式Wordpress主題,我無法弄清楚作者是如何得到<h>元素的行高的em值的。我已經通過了以下教程here.響應Web排版(用於ems中的行高計算)代碼解釋需要

本教程非常有幫助,但我看不出以下代碼的作者是如何得出他/她的數字的。如果有人能解釋這個作者使用的公式和過程,我會非常感激。看來14px是基本字體大小,22px是產生1.57142857(22/14 = 1.57142857)的基礎領先的基本邊距。除此之外,我無法看到作者的元素行高值的推理。

body { font:normal 14px/1.57142857 Arial,"Helvetica Neue",Helvetica,sans-serif; } 

h1, h2, h3, h4, h5, h6, 
p, blockquote, pre, address, 
dl, ol, ul, table, 
legend, hr, figure {  
margin-bottom:22px; 
} 

li > ul, 
li > ol { 
margin-bottom:0; 
} 

/* Headings */ 
h1, .h1 { font-size:60px; line-height:1.10000000; font-weight:normal; } 
h2, .h2 { font-size:36px; line-height:1.16666667; font-weight:normal; } 
h3, .h3 { font-size:24px; line-height:1.25000000; font-weight:normal; } 
h4, .h4 { font-size:18px; line-height:1.33333333; font-weight:normal; } 
h5, .h5 { font-size:14px; line-height:1.57142857; font-weight:normal; } 
h6, .h6 { font-size:12px; line-height:1.57142857; font-weight:normal; } 

回答

0

作者一定是用modular scale.

檢查它是如何被使用的Zurb的基礎框架description

+0

謝謝你的迴應。我會按照你的建議鏈接,並嘗試將它拼湊在一起。這些值似乎太精確,不會隨意。 – rml