试题
考点

js语言和框架-CSS、CSS3-盒模型、弹性盒布局

面5笔5

使用flex怎么实现元素的水平居中和垂直居中?

前往“校招VIP”小程序,刷题更快
最新校招难题刷题,快来进刷题群吧
解答

水平居中:

.box {
display: flex;
justify-content: center;
}

垂直居中:

.box {
display: flex;
align-items: center;
}

水平垂居中:

.box {
display: flex;
justify-content: center;
align-items: center;
}


评论

48

2020-08-11 15:05:57

0 0

Turbo

2020-08-11 12:37:33

0 0

fighting8960

2020-08-11 11:32:26

0 0

加载更多