Ecommerce category design using Html CSS and Bootstrap 5
Ecommerce category template design using Html CSS and Bootstrap 5
How to make eCommerce Categories design using Html CSS and Bootstrap 5
In this post, you will be learning how to make customized Category View design for e-commerce using HTML, CSS, and Bootstrap 5.
View:
Now, To achive the above design for the Ecommerce Category 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 Category Design</title>
<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 Categories</h4>
</div>
<div class="col-6 col-md-3">
<div class="category-card">
<a href="">
<div class="category-card-img">
<img src="laptop.jpg" class="w-100" alt="Laptop">
</div>
<div class="category-card-body">
<h5>Laptop</h5>
</div>
</a>
</div>
</div>
<div class="col-6 col-md-3">
<div class="category-card">
<a href="">
<div class="category-card-img">
<img src="mobile.jpg" class="w-100" alt="Mobile Devices">
</div>
<div class="category-card-body">
<h5>Mobile</h5>
</div>
</a>
</div>
</div>
<div class="col-6 col-md-3">
<div class="category-card">
<a href="">
<div class="category-card-img">
<img src="mens-fashion.jpg" class="w-100" alt="Mens Fashion">
</div>
<div class="category-card-body">
<h5>Mens Fashion</h5>
</div>
</a>
</div>
</div>
<div class="col-6 col-md-3">
<div class="category-card">
<a href="">
<div class="category-card-img">
<img src="women.jpg" class="w-100" alt="Women Fashion">
</div>
<div class="category-card-body">
<h5>Women Fashion</h5>
</div>
</a>
</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:
/* Category Start */
.category-card{
border: 1px solid #ddd;
box-shadow: 0 0.125rem 0.25rem rgb(0 0 0 / 8%);
margin-bottom: 24px;
background-color: #fff;
}
.category-card a{
text-decoration: none;
}
.category-card .category-card-img{
max-height: 260px;
overflow: hidden;
border-bottom: 1px solid #ccc;
}
.category-card .category-card-body{
padding: 10px 16px;
}
.category-card .category-card-body h5{
margin-bottom: 0px;
font-size: 18px;
font-weight: 600;
color: #000;
text-align: center;
}
/* Category End */
Thanks for reading.