Ecommerce Products List template design using Html CSS and Bootstrap
E-Commerce Products List Template Design using Bootstrap 5
How to make eCommerce Product list design template using Html CSS and Bootstrap 5
In this post, you will be learning how to make customized Product List View design for e-commerce using HTML, CSS, and Bootstrap 5.
View:
Now, To achieve the above design for the Ecommerce Product card Template follow the below steps.
Step 1: Write basic HTML 5 template in index.html and link style.css file to the index.html file.
index.html Page
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Ecommerce Navbar Design</title>
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="py-3 py-md-5 bg-light">
<div class="container">
<div class="row">
<div class="col-md-12">
<h4 class="mb-4">Our Products</h4>
</div>
<div class="col-md-3">
<div class="product-card">
<div class="product-card-img">
<label class="stock bg-success">In Stock</label>
<img src="hp-laptop.jpg" alt="Laptop">
</div>
<div class="product-card-body">
<p class="product-brand">HP</p>
<h5 class="product-name">
<a href="">
HP Laptop
</a>
</h5>
<div>
<span class="selling-price">$500</span>
<span class="original-price">$799</span>
</div>
<div class="mt-2">
<a href="" class="btn btn1">Add To Cart</a>
<a href="" class="btn btn1"> <i class="fa fa-heart"></i> </a>
<a href="" class="btn btn1"> View </a>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="product-card">
<div class="product-card-img">
<label class="stock bg-success">In Stock</label>
<img src="mobile-redmi-note-8.jpg" alt="Red MI Note 8">
</div>
<div class="product-card-body">
<p class="product-brand">MI</p>
<h5 class="product-name">
<a href="">
Red MI Note 8
</a>
</h5>
<div>
<span class="selling-price">$200</span>
<span class="original-price">$300</span>
</div>
<div class="mt-2">
<a href="" class="btn btn1">Add To Cart</a>
<a href="" class="btn btn1"> <i class="fa fa-heart"></i> </a>
<a href="" class="btn btn1"> View </a>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="product-card">
<div class="product-card-img">
<label class="stock bg-success">In Stock</label>
<img src="casual-shirt.jpg" alt="Mens Shirt">
</div>
<div class="product-card-body">
<p class="product-brand">Levis</p>
<h5 class="product-name">
<a href="">
Mens Shirt
</a>
</h5>
<div>
<span class="selling-price">$299</span>
<span class="original-price">$359</span>
</div>
<div class="mt-2">
<a href="" class="btn btn1">Add To Cart</a>
<a href="" class="btn btn1"> <i class="fa fa-heart"></i> </a>
<a href="" class="btn btn1"> View </a>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="product-card">
<div class="product-card-img">
<label class="stock bg-success">In Stock</label>
<img src="headphone.jpg" alt="Head Phone">
</div>
<div class="product-card-body">
<p class="product-brand">Asus</p>
<h5 class="product-name">
<a href="">
Head Phone
</a>
</h5>
<div>
<span class="selling-price">$399</span>
<span class="original-price">$499</span>
</div>
<div class="mt-2">
<a href="" class="btn btn1">Add To Cart</a>
<a href="" class="btn btn1"> <i class="fa fa-heart"></i> </a>
<a href="" class="btn btn1"> View </a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
Step 2: Create style.css file and link to the above index.html file and paste the below CSS code in style.css:
/* Product Card */
.product-card{
background-color: #fff;
border: 1px solid #ccc;
margin-bottom: 24px;
}
.product-card a{
text-decoration: none;
}
.product-card .stock{
position: absolute;
color: #fff;
border-radius: 4px;
padding: 2px 12px;
margin: 8px;
font-size: 12px;
}
.product-card .product-card-img{
max-height: 260px;
overflow: hidden;
border-bottom: 1px solid #ccc;
}
.product-card .product-card-img img{
width: 100%;
}
.product-card .product-card-body{
padding: 10px 10px;
}
.product-card .product-card-body .product-brand{
font-size: 14px;
font-weight: 400;
margin-bottom: 4px;
color: #937979;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.product-card .product-card-body .product-name{
font-size: 20px;
font-weight: 600;
color: #000;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.product-card .product-card-body .selling-price{
font-size: 22px;
color: #000;
font-weight: 600;
margin-right: 8px;
}
.product-card .product-card-body .original-price{
font-size: 18px;
color: #937979;
font-weight: 400;
text-decoration: line-through;
}
.product-card .product-card-body .btn1{
border: 1px solid;
margin-right: 3px;
border-radius: 0px;
font-size: 12px;
margin-top: 10px;
}
/* Product Card End */
Thanks for reading.