I have a project in eCommerce that I'm working on. Currently, I am facing an issue where the height of the product list varies and disrupts the overall alignment when I insert additional content.
Below is the code snippet I am using with Bootstrap 4:
#product_list {
width: 210px;
margin-right: 0px;
font-size: 14px;
}
.product-item {
width: 100%;
height: 350px;
cursor: pointer;
background-color: #FFFFFF;
}
.product {
width: 100%;
height: 350px;
border: solid 2px #e9e9e9;
}
.product_image {
width: 100%;
text-align: center;
}
.product_image img {
width: 70%;
height: 70%;
}
<!-- Start to products display -->
<ul class="inline-item pt-2" style="padding-left:0px;padding-right:0px;" id="product_list_grid">
<li class="list-inline-item mb-1" id="product_list">
<div class="product-item mb-1">
<div class="product">
<div class="product_image">
<a href="single.html"> <img src="images/FREEDOM.png" alt=""></a>
</div>
<div class=" text-center mb-0 ">
<h6 class="product_brand"><a class="text-dark" href="single.html">Ashirvad</a></h6>
<h6 class="product_name">
<p class="card-text m-0">
<label> Ahirvad </label>
<button type="button" class="btn btn-sm text-white " id="background_color" data-toggle="modal" data-target="#myModal1"> 1kg </button>
</p>
</h6>
<p class=" mb-0">
<span>20pc/Box</span> ❙ <span>Min 5 boxes</span>
</p>
<div class="product_price">
<span>MRP : <del>$50</del></span> ❙ <span> <b> Sale : $40 </b> </span>
</div>
<div class="quantity mb-1 ">
<input type="button" value="-" class="minus " style="border-radius:50px;">
<span> 1 </span>
<input type="button" value="+" class="plus" style="border-radius:50px;">
</div>
<div class=" text-center my-2 ">
<a class="btn btn-sm text-white" id="background_color" href="#">add to cart</a>
</div>
</div>
</div>
</div>
</li>
<li class="list-inline-item mb-1" id="product_list">
<div class="product-item mb-1">
<div class="product">
<div class="product_image">
<a href="single.html"> <img src="images/FREEDOM.png" alt=""></a>
</div>
<div class=" text-center mb-0 ">
<h6 class="product_brand"><a class="text-dark" href="single.html">Ashirvad</a></h6>
<h6 class="product_name">
<p class="card-text m-0">
<label> Ahirvad </label>
<button type="button" class="btn btn-sm text-white " id="background_color" data-toggle="modal" data-target="#myModal1"> 1kg </button>
</p>
</h6>
<p class=" mb-0">
<span>20pc/Box</span> ❙ <span>Min 5 boxes</span>
</p>
<div class="product_price"> <span>MRP : <del>$50</del></span> ❙ <span> <b>
Sale : $40 </b> </span> </div>
<div class="quantity mb-1 ">
<input type="button" value="-" class="minus " style="border-radius:50px;">
<span> 1 </span>
<input type="button" value="+" class="plus" style="border-radius:50px;">
</div>
<div class=" text-center my-2 "><a class="btn btn-sm text-white" id="background_color" href="#">add to cart</a></div>
</div>
</div>
</div>
</li>
........
</ul>
I am encountering a height alignment issue when adding content to the product list, and it's causing disruptions in the display. The issue is resolved when the list items have uniform content and images.