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
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
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