由于 justify-content: space-around 規則,當第 4 個塊向下跳時,它變成了中間我可以以某種方式仍然使用空格規則,但使最后一個塊不要跳到中心,而是跳到左側,就像屏幕截圖中那樣?PS我仍然需要 justify-content: space-around 因為它具有響應式邊距這是代碼https://jsfiddle.net/s4fbtkyg/<html><body><style> .block{ background-color: grey; flex-basis: 100px; margin-bottom: 5px;}.container{ display: flex; flex-wrap: wrap; justify-content: space-around;}</style><div class="container"> <div class="block">1</div> <div class="block">2</div> <div class="block">3</div> <div class="block">4</div> </div></body></html>截屏
CSS:如何將最后一個元素向左對齊
ibeautiful
2023-12-11 15:27:43