box-align Description
The Box-align property that specifies when the elements of the element are arranged vertically in a specified direction. < the order in which the neutron elements in the specified box are displayed. >
When container elements are much larger than child elements, you can use the Box-align property to specify the sort order of child elements, and you can specify how child elements are represented.
Also, the longitudinal direction of the arrangement, which can be interpreted as the configuration direction of the elements in the element, the default value is horizontal, and this property is used to arrange the vertical direction. You can also use box-orient:vertical to set the direction of the child element arrangement.
Property value
Start: The standard direction element, the upper end of each sub-feature is arranged along the upper end of the element, the remaining position is sorted downward, and the opposite element is sorted along the lower end, and the remaining positions are sorted upward. < for a normal-orientation box, the top edge of each child element is placed along the edge of the box. For boxes in the opposite direction, the lower edge of each child element is placed along the bottom of the box. >
End: The standard direction element, the lower side of each sub-feature is arranged along the lower end of the element, the remaining positions are sorted upward, and the opposing elements are sorted along the upper end, and the remaining positions are sorted down. < for normal-orientation boxes, the lower edge of each child element is placed along the bottom of the box. For a box that is in the opposite direction, the top edge of each child element is placed along the edge of the box. >
Center: The remaining space for equal distribution. < divide the extra space equally, half on the child element, and the other half below the child element. >
Baseline:inline-axis and horizontal, all child elements baseline configuration arrangement < If box-orient is Inline-axis or horizontal, all child elements are aligned with their baselines. >
Stretch: Each child element is automatically sorted according to the height of the container element (default value)
About centering
The original horizontal vertical center is written as: Height=line-height Vertical Center text-align to achieve horizontal center
Now use Box-align to achieve horizontal centering with vertical center Box-pack
<! DOCTYPE html>
Instance Code
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
Example diagram