Home > Web Front-end > CSS Tutorial > [CSS] Two ways to vertically center child elements

[CSS] Two ways to vertically center child elements

高洛峰
Release: 2017-02-21 10:59:03
Original
2098 people have browsed it

1. Multiple sub-elements are arranged horizontally, invalid below IE10

display: flex;
align-items: center;
justify-content: center;
Copy after login

[CSS] 子元素垂直居中的两种方式

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;
Copy after login

[CSS] 子元素垂直居中的两种方式

 

More [CSS] Two ways to vertically center child elements. For related articles, please pay attention to the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template