1 回答

TA貢獻(xiàn)1951條經(jīng)驗(yàn) 獲得超3個(gè)贊
您的容器中沒有額外的高度,因此沒有用于居中的可用空間。
進(jìn)行此調(diào)整:
.container {
display: flex;
flex-direction: row;
justify-content: space-around;
/* align-items: center */ /* vertically centers both left and right elements */
flex-wrap: wrap;
height: 100vh; /* child would inherit height through align-content: stretch default */
}
.left-side {
display: flex;
flex-direction: column;
width: 800px;
align-self: center; /* vertically centers the flex item */
/* justify-content: center; */ /* vertically centers the content of the flex item */
}
- 1 回答
- 0 關(guān)注
- 176 瀏覽
添加回答
舉報(bào)