Home > Article > Web Front-end > [CSS] Two ways to vertically center child elements
1. Multiple sub-elements are arranged horizontally, invalid below IE10
display: flex; align-items: center; justify-content: center;
2. Multiple sub-elements are arranged vertically. This method will cause the margin to be invalid and invalid below IE8
display: table-cell; vertical-align: middle;
More [CSS] Two ways to vertically center child elements. For related articles, please pay attention to the PHP Chinese website!