-
水平居中
- 行内元素:
text-align: center
- 块级元素:
margin: 0 auto
absolute + transform
flex + justify-content: center
- 行内元素:
-
垂直居中
line-height: height
absolute + transform
flex + align-items: center
table
-
水平垂直居中
absolute + transform
flex + justify-content + align-items
CSS居中布局
猜你喜欢
转载自www.cnblogs.com/barryzhang/p/10394689.html
今日推荐
周排行