2 回答

TA貢獻1906條經驗 獲得超10個贊
要修復此問題,您可以將 .container justify-content 值從更改justify-content:center
為justify-content:start

TA貢獻1831條經驗 獲得超10個贊
他們的 .css 代碼中存在錯誤。在 .Box 中,您需要更改 .box 中的高度和寬度,或者需要更改滾動容器的寬度,因為您將大小設置為 300px,將其更改為 500 或更少,并且放置了 4 種顏色的100px 現在我將代碼更正為 50px 并且它可以工作。
p {
font-family: Lato;
}
.container {
display: flex;
justify-content: start;
width: 300px;
overflow-x: scroll;
}
.red {
background-color: red;
margin-right: 10px;
flex-shrink: 0;
}
.yellow {
background-color: yellow;
margin-right: 10px;
flex-shrink: 0;
}
.blue {
background-color: blue;
margin-right: 10px;
flex-shrink: 0;
}
.green {
background-color: green;
flex-shrink: 0;
}
.box {
width: 50px;
height: 50px;
}
- 2 回答
- 0 關注
- 145 瀏覽
添加回答
舉報