正如你所看到的,每當我調整窗口大小時,水平相鄰元素之間的間隙就被打亂了。有什么辦法可以解決這個問題嗎?
這是負責表格的代碼:
main { /* takes care of building the grid
display: grid;
grid-template-columns: repeat(auto-fit, minmax(589.19px, auto));
overflow-x: hidden;
justify-items: center;
align-items: center;
}
.character-card{ /* takes care of the content inside the individual cells
display: flex;
margin: 13.5px;
background-color: rgb(60,62,68);
border-radius: 10px;
box-shadow: 0 0 10px rgba(37, 37, 37, 0.5);
}
要查看完整的代碼,這里是我的代碼筆: https://codepen.io/Alessandro-Garcia/pen/RwqNaPq