CSS in-depth understanding of vertical-align

1. Scope of use

1. Inline elements, inline-block elements and table-cell elements are valid, but invalid for block-level elements

2. Attribute value

Negative numbers, percentages and keywords

3. The principle of action

1. Used to define the vertical alignment of "surrounding text, inline elements, and inline-block elements" relative to the baseline of the defined vertical-align element.

2. The vertical-align attribute of the table-cell element is for itself. The alignment of inner child elements defined by vertical-align relative to itself.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324882514&siteId=291194637