flex方法
首先要给父级元素规定固定高度,在子元素样式中添加如下代码:
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
flex方法
首先要给父级元素规定固定高度,在子元素样式中添加如下代码:
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;