css - vertical-align中描述的, 父级的基线, 指的是行框的基线吗?
ringa_lee
ringa_lee 2017-04-17 11:44:26
0
2
711

MDN原话: Aligns the baseline of the element with the subscript-baseline of its parent.

我只知道每个行内框都有四条线, 但是行框也有吗?
照我的理解, 先有行内框, 后有行框, 再有对齐.行框高度根据最大行内框的高度来决定.
那让最大行内框的vertical-align等于top不就会远远超出行框了吗?
显然这是错的.
所有想弄明白, vertical-align到底是如何依据行框来对齐的. 或者根本不是依据行框来对齐

ringa_lee
ringa_lee

ringa_lee

reply all(2)
巴扎黑

I just want to say that this attribute is a rather magical attribute, and the specifications are also confusing.
You are right, the height of the linebox is determined by the largest inline box. If there is only one inline element, it is easier to understand. You can get the baseline line position according to the four lines.
So, if there are two inline boxes in one line, the position of the baseline is more interesting. The more classic vertical centering uses this attribute vertical-align:middle .
What if there are three or more inlineboxes?

I may not be able to explain it clearly, so I’ll give you a link: Vertical-Align: All You Need To Know - Christopher Aue

Hope it will be adopted.

洪涛

1. The vertical-align attribute is only valid for inline elements. It is valid for inline boxes (display:inline;). It is not available for inline boxes (display:inline-block;) and line boxes (display:block;). Function
2. http://blog.sina.com.cn/s/blo... You can read the explanation here

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template