Hi Team
I need some help with my div card, i want to move them side to side using d-flex adjust-content between, but they appear to move side to side.
// css file
.cards-container {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.card-container {
margin: 10px;
}
.cards-container_0 {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.card-container_0 {
margin: 10px;
}
.card-body {
display: flex;
flex-direction: row;
align-items: center;
height: 30px;
}
.icon {
font-size: 24px;
margin-right: 5px;
}
h3 {
margin: 0;
font-size: 14px;
}
// Bootstrap div cards
📖
Health and Beauty
👕
Clothing & Accessories
🎮
Toys & Hobbies
💻
Home & Appliances
📢
TV & Audio
🏃
Sport & Outdoor
💻
Computer & Tablets
💻
Home Improvement
📷
Photography
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Tuhin PaulPosted Mar 31, 2023, 2:43 AM
I can see you have multiple cards-container classes, which might be causing some confusion. You only need one cards-container class to contain all the card elements. Additionally, you have different justify-content properties for each cards-container class, which is causing the cards to move around inconsistently. To move the cards side-to-side with equal spacing in between, you should remove the justify-content properties from the cards-container class and add justify-content-between to the card-container class instead.
Tuhin PaulPosted Mar 31, 2023, 2:45 AM
See below for the updated CSS code
HTML: