一直以來都搞不懂vertical-align,它適用于什么元素,它的對齊規則是什么樣的。索性查了下w3c相關規范,發現行高和基線對齊的規范說明里有如下內容:
This section is being rewritten. Refer to section 10.8 of [CSS2] for the normative CSS definition or the 2002 Working Draft if you want pretty pictures. (But ignore the old text, half of it’s wrong. We’re not specifying which half, that’s to be determined.) The CSS2 specification should be used as the guideline for implementation.
額。。。既然正在重寫,那我還是先簡單了解下它吧。
參考資料:
https://www.w3.org/TR/css-inline-3/#line-height
http://www.w3cplus.com/css/what-is-vertical-align.html