I'm trying to create an e-commerce site and I want to display 3 items in a row. However, when I use flex, the cards stack on top of each other instead of forming a row. How can I align them properly? I believe the issue lies with the .product-item class. Can someone assist me with this problem, please? MY CSS:
* {
box-sizing: border-box;
border: 1px #e2e2e2;
}
.product-item {
width: 300px;
height:205px;
text-align: center;
border: 1px #e2e2e2;
background: white;
font-family: "Roboto";
}
.product-item img {
display: inline-block;
width: 100%;
border: 1px #e2e2e2;
}
.product-list {
background: #fafafa;
padding: 15px 0;
}
.product-list h3 {
font-size: 20px;
font-family: "Roboto";
text-align: left;
margin: 25px;
font-weight: 400;
color: #333333;
}
.product-list h4 {
font-size: 15px;
font-family: "Roboto";
text-align: left;
margin: 25px;
font-weight: 400;
color: #666666;
}
.sell {
font-size: 20px;
font-family: "Roboto";
color: #333333;
margin: 65px;
}
.price {
font-size: 35px;
text-align: left;
font-family: "Roboto";
color: #333333;
margin: -65px;
}
.cart img {
margin-top: -60px;
margin-left: 200px;
width: 15%;
}
My HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Card Set</title>
<link rel="stylesheet" type="text/css" href="cardset.css">
<script src="script.js"></script>
</head>
<body>
<div class="product-item">
<img src="boots.png">
<div class="product-list">
<h3>Women's Boots</h3>
<h4>Fashionable boots made from natural nubuck. Keep your feet warm during winter.</h4>
<p><span class='price'>1999</span><span class='sell'>rub.</span><div class="cart"><img a href="" src="cart.png">
</div>
</div>
<div class="product-item">
<img src="boots.png">
<div class="product-list">
<h3>Women's Boots</h3>
<h4>Fashionable boots made from natural nubuck. Keep your feet warm during winter.</h4>
<p><span class='price'>1999</span><span class='sell'>rub.</span><div class="cart"><img a href="" src="cart.png">
</div>
</div>
</body>
</html>