码农的日常之Web前端Web前端之路重修前端

vertical-align浅析

2016-06-18  本文已影响57人  爆裂边缘

一直以来都搞不懂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

上一篇下一篇

猜你喜欢

热点阅读