垂直居中布局
居中的各种实现方案
html
1 |
|
水平居中布局的实现
(1) inline-block + text-align
1 |
|
(2) table + margin
1 |
|
(3) absolute + transform
1 |
|
(4) flex + justify-content
1 |
|
垂直居中的实现
(1) table-cell + vertical-align
1 |
|
(2) absolute + transform
1 |
|
(3) flex + align-items
1 |
|
居中(水平居中+垂直居中)
(1) inline-block+text-align + table-cell+vertical-align
1 |
|
(2) absolute + transform
1 |
|
(3) flex + justify-content + align-items
1 |
|
垂直居中布局
https://jacksiongt.github.io/2021/04/30/csscenter/