Build Responsive Ecommerce Website Using HTML CSS JAVASCRIPT

Last Updated on September 30th, 2021 by Codevo
ecommerce website with html css

In this article, I will show you how to create a responsive e-commerce website using HTML, CSS, and JAVASCRIPT.

I know everyone knows how to make this kind of design. However, I think there are many beginners who do not know how to create an e-commerce website using HTML, CSS, and JAVASCRIPT.

Hopefully, this article will help them.

Before we start, I should clarify what I meant by building a responsive e-commerce website using HTML, CSS, and JAVASCRIPT.

If you are building a fully functional ecommerce website, you will have to build the frontend with a framework that looks more presentable in the eyes of users and also a backend that will be communicating with a database.

The picture am trying to paint is that a complete ecommerce website can't be built with only HTML, CSS, and JAVASCRIPT.

You will need to save users data in a database which will also require a backend.

In this blog, I will try my best to help you build an ecommerce website template with HTML, CSS and JAVASCRIPT step by step.

You can later convert this template to any frontend framework you know like REACTJS, ANGULARJS or VUEJS and also connect it to a backend like NODEJS, PHP, PYTHON etc.

Features of an Ecommerce Website:

  • SEO Friendly website
  • Chat Widget for Messaging
  • Responsive on all devices
  • Product Navigation
  • Search Box
  • Product Cart
  • Payment Methods
  • Security

Things Needed(Plugins):

Basic Setup:

Create a new directory and give it a name of your choice. Download the image file and unzip it. Now copy or move the downloaded images folder and paste it into your project directory.

Now open your project with any text editor of your choice, in this article I will be using VISUAL STUDIO CODE. You can use any text editor since the final result is the same regardless of what text editor you use.

I went for this approach because we are not going to build a backend for fetching data. If you are getting confuse I created this youtube video to guide you through every step.

Setup files

Styles.css

:root {
--primary: #ff4545;
--white: #fff;
--black: #222;
--grey1: #3a3b3c;
--grey2: #828282;
}
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: inherit;
}
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap");
html {
box-sizing: border-box;
font-size: 62.5%;
}
body {
font-family: "Open Sans", sans-serif;
font-size: 1.6rem;
background-color: var(--white);
color: var(--black);
font-weight: 400;
}
h1,
h2,
h3,
h4,
h5 {
font-weight: 600;
}
a {
text-decoration: none;
color: inherit;
}
li {
list-style: none;
}
.container {
max-width: 114rem;
margin: 0 auto;
}
@media only screen and (max-width: 1200px) {
.container {
padding: 0 3rem;
}
}
@media only screen and (max-width: 768px) {
.container {
max-width: 60rem;
}
}
.d-flex {
display: flex;
align-items: center;
}
styles.css

index.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Favicon -->
<link rel="shortcut icon" href="./images/favicon.ico" type="image/x-icon" />
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" />
<!-- Glidejs -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Glide.js/3.4.1/css/glide.core.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Glide.js/3.4.1/css/glide.theme.css">
<!-- Custom StyleSheet -->
<link rel="stylesheet" href="./styles.css" />
<title>Codevo - Ecommerce Website</title>
</head>
<body>
<!-- Glidejs -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/Glide.js/3.4.1/glide.min.js"></script>
<!-- Custom Scripts -->
<script src="./js/products.js"></script>
<script src="./js/slider.js"></script>
<script src="./js/index.js"></script>
</body>
</html>
index.html

If you face errors/problems while copying and pasting the various code snippets then download the source code from the button below.

Github link

Download Code Files

0 COMMENTS

Congratulations, you have the opportunity to be the first commenter on this article. Have a question or suggestion? Please leave a comment to start the discussion.

LEAVE A REPLY