Module 1: Project Overview and Documentation
Project Goal
The goal of this project is to create a simplified clone of the Amazon homepage using HTML and CSS. This project will help you understand how to build a structured web page and style it to closely resemble a popular website.
Technologies Used
- HTML5: To create the structure of the web page.
- CSS3: To style the web page and make it visually appealing.
- Unsplash: For freely available images to use in the project.
- Responsive Design Techniques: To ensure the website looks good on different devices.
Project Structure
HTML Structure (Module 2):
- Header section with a navigation menu and search bar.
- Hero section with promotional banners.
- Featured products section with images and descriptions.
- Footer section with additional links.
CSS Styling (Module 3):
- General reset and basic styles for the body and container elements.
- Specific styles for the header, navigation, hero section, featured products, and footer.
- Responsive design to ensure the layout adjusts on smaller screens.
Steps to Follow
Set Up the Project:
- Create a project folder and add the necessary files:
index.html
andstyles.css
. - Link the CSS file to the HTML file.
- Create a project folder and add the necessary files:
Create the HTML Structure:
- Define the basic structure of the HTML document.
- Create the header section with a navigation menu and search bar.
- Add the hero section with promotional banners.
- Create the featured products section with images.
- Add the footer section.
Add CSS Styling:
- Apply general styles to reset default browser styles and set basic styles.
- Style the header and navigation menu.
- Style the hero section.
- Style the featured products section.
- Style the footer.
- Add responsive design using media queries.
Resources
HTML and CSS Documentation:
Unsplash for Images:
Responsive Design Techniques:
Additional Tips
Test on Multiple Devices:
- Ensure the site looks good on different devices and screen sizes.
- Use browser developer tools to simulate different device viewports.
Code Comments:
- Add comments to your code to explain the purpose of different sections.
- This will help in maintaining and understanding the code in the future.
Clean Code:
- Keep your code clean and organized.
- Use consistent indentation and naming conventions.
By following this documentation and the subsequent modules, you will be able to create a basic clone of the Amazon homepage that is visually similar and responsive. This project will help you understand how to structure a web page with HTML and style it effectively with CSS.
Module 2: HTML Structure
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Character encoding for the document -->
<meta charset="UTF-8">
<!-- Viewport settings to ensure proper scaling on different devices -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Title of the webpage -->
<title>Amazon Clone</title>
<!-- Link to the external CSS stylesheet -->
<link rel="stylesheet" href="styles.css">
</head>
<body>
<!-- Header section with navigation menu and search bar -->
<header>
<!-- Container to center and contain the header content -->
<div class="container">
<!-- Website logo or title -->
<h1>Amazon</h1>
<!-- Navigation menu -->
<nav>
<ul>
<!-- List of navigation links -->
<li><a href="#">Home</a></li>
<li><a href="#">Today's Deals</a></li>
<li><a href="#">Customer Service</a></li>
<li><a href="#">Registry</a></li>
<li><a href="#">Gift Cards</a></li>
<li><a href="#">Sell</a></li>
</ul>
</nav>
<!-- Search bar form -->
<form class="search-bar">
<!-- Search input field -->
<input type="text" placeholder="Search">
<!-- Search button -->
<button type="submit">Search</button>
</form>
</div>
</header>
<!-- Hero section with promotional banners -->
<section class="hero">
<!-- Container to center and contain the hero content -->
<div class="container">
<!-- Hero section heading -->
<h2>Shop the best deals today.</h2>
<!-- Container for promotional banners -->
<div class="banners">
<!-- Individual banner for electronics -->
<div class="banner">
<img src="https://source.unsplash.com/800x400/?electronics" alt="Electronics">
<h3>Electronics</h3>
</div>
<!-- Individual banner for fashion -->
<div class="banner">
<img src="https://source.unsplash.com/800x400/?fashion" alt="Fashion">
<h3>Fashion</h3>
</div>
<!-- Individual banner for home -->
<div class="banner">
<img src="https://source.unsplash.com/800x400/?home" alt="Home">
<h3>Home</h3>
</div>
</div>
</div>
</section>
<!-- Featured products section -->
<section class="featured">
<!-- Container to center and contain the featured content -->
<div class="container">
<!-- Featured products section heading -->
<h2>Featured Products</h2>
<!-- Container for featured products -->
<div class="products">
<!-- Individual product -->
<div class="product">
<img src="https://source.unsplash.com/300x300/?laptop" alt="Laptop">
<h3>High Performance Laptop</h3>
</div>
<!-- Individual product -->
<div class="product">
<img src="https://source.unsplash.com/300x300/?shoes" alt="Shoes">
<h3>Comfortable Running Shoes</h3>
</div>
<!-- Individual product -->
<div class="product">
<img src="https://source.unsplash.com/300x300/?smartphone" alt="Smartphone">
<h3>Latest Smartphone</h3>
</div>
</div>
</div>
</section>
<!-- Footer section -->
<footer>
<!-- Container to center and contain the footer content -->
<div class="container">
<!-- Footer copyright text -->
<p>© 2024 Amazon Clone</p>
</div>
</footer>
</body>
</html>
Explanation:
DOCTYPE and HTML Structure:
<!DOCTYPE html>
: Declares the document type and version of HTML being used.<html lang="en">
: Opens the HTML document and sets the language to English.
Head Section:
<meta charset="UTF-8">
: Specifies the character encoding for the HTML document.<meta name="viewport" content="width=device-width, initial-scale=1.0">
: Ensures proper scaling on different devices.<title>Amazon Clone</title>
: Sets the title of the webpage.<link rel="stylesheet" href="styles.css">
: Links to an external CSS file for styling.
Body Section:
Header:
<header>
: Defines the header section of the page.<div class="container">
: A container to center and contain the header content.<h1>Amazon</h1>
: Represents the website logo or title.<nav>
: Defines the navigation menu.<ul>
: Unordered list for navigation links.<li><a href="#">...</a></li>
: List items with anchor tags for navigation links.
<form class="search-bar">
: Defines a form for the search bar.<input type="text" placeholder="Search">
: Input field for the search query.<button type="submit">Search</button>
: Button to submit the search form.
Hero Section:
<section class="hero">
: Defines the hero section with promotional banners.<div class="container">
: A container to center and contain the hero content.<h2>Shop the best deals today.</h2>
: Heading for the hero section.<div class="banners">
: Container for promotional banners.<div class="banner">...</div>
: Individual banner with an image and caption.
Featured Products:
<section class="featured">
: Defines the featured products section.<div class="container">
: A container to center and contain the featured content.<h2>Featured Products</h2>
: Heading for the featured products section.<div class="products">
: Container for featured products.<div class="product">...</div>
: Individual product with an image and caption.
Footer:
<footer>
: Defines the footer section of the page.<div class="container">
: A container to center and contain the footer content.<p>© 2024 Amazon Clone</p>
: Copyright text.
Module 3: CSS Styling
Here’s the CSS code to style the HTML structure created above:
/* Reset some default browser styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box; /* Ensure consistent box-sizing */
}
/* Set the basic font and line height for the body */
body {
font-family: Arial, sans-serif; /* Use Arial or default sans-serif font */
line-height: 1.6; /* Set line height */
}
/* Container class to center the content and set a width */
.container {
width: 80%; /* Set width to 80% */
margin: auto; /* Center horizontally */
overflow: hidden; /* Hide overflow */
}
/* Header styling */
header {
background: #232F3E; /* Amazon dark blue background */
color: #fff; /* White text color */
padding: 20px 0; /* Padding top and bottom */
border-bottom: #E47911 3px solid; /* Bottom border */
display: flex; /* Use flexbox layout */
justify-content: space-between; /* Space items between */
align-items: center; /* Align items vertically */
}
/* Header title styling */
header h1 {
margin-top: 0; /* No margin at the top */
}
/* Navigation styling */
header nav {
flex: 1; /* Allow flex grow */
margin-left: 20px; /* Left margin */
}
header nav ul {
list-style: none; /* Remove list style */
display: flex; /* Use flexbox layout */
justify-content: space-around; /* Space items around */
}
header nav ul li a {
color: #fff; /* White color */
text-decoration: none; /* Remove underline */
font-weight: bold; /* Bold text */
}
/* Search bar styling */
header .search-bar {
display: flex; /* Use flexbox layout */
}
header .search-bar input[type="text"] {
padding: 10px; /* Padding */
border: 1px solid #ccc; /* Gray border */
border-radius: 5px 0 0 5px; /* Rounded corners for the left side */
width: 200px; /* Fixed width */
}
header .search-bar button {
padding: 10px; /* Padding */
border: none; /* No border */
background: #E47911; /* Amazon orange background */
color: #fff; /* White text color */
cursor: pointer; /* Pointer cursor */
border-radius: 0 5px 5px 0; /* Rounded corners for the right side */
}
/* Hero section styling */
.hero {
padding: 50px 0; /* Padding top and bottom */
background: #f4f4f4; /* Light gray background */
text-align: center; /* Center text */
}
/* Hero section title */
.hero h2 {
margin-bottom: 20px; /* Margin at the bottom */
}
/* Banners container */
.hero .banners {
display: flex; /* Use flexbox layout */
justify-content: space-around; /* Space around items */
}
.hero .banner {
text-align: center; /* Center text */
margin: 0 10px; /* Margin left and right */
}
.hero .banner img {
width: 100%; /* Full width */
border-radius: 10px; /* Rounded corners */
}
/* Featured section styling */
.featured {
padding: 30px 0; /* Padding top and bottom */
background: #fff; /* White background */
}
/* Featured section title */
.featured h2 {
text-align: center; /* Center text */
margin-bottom: 20px; /* Margin at the bottom */
}
/* Products container */
.featured .products {
display: flex; /* Use flexbox layout */
justify-content: space-around; /* Space around items */
}
.featured .product {
text-align: center; /* Center text */
margin: 0 10px; /* Margin left and right */
}
.featured .product img {
width: 100%; /* Full width */
border-radius: 10px; /* Rounded corners */
}
/* Footer styling */
footer {
padding: 20px 0; /* Padding top and bottom */
background: #232F3E; /* Amazon dark blue background */
color: #fff; /* White text color */
text-align: center; /* Center text */
}
/* Responsive design for mobile devices */
@media (max-width: 768px) {
.container {
width: 90%; /* Increase width on smaller screens */
}
header nav ul {
flex-direction: column; /* Stack items vertically */
}
header nav ul li {
margin-bottom: 10px; /* Add bottom margin */
}
.hero .banners,
.featured .products {
flex-direction: column; /* Stack items vertically */
}
.hero .banner,
.featured .product {
margin-bottom: 20px; /* Add bottom margin */
}
}
Explanation:
Global Styles:
*
: Reset margin, padding, and setbox-sizing
toborder-box
for all elements.
Body:
- Set the font family to Arial or sans-serif and a line height of 1.6 for readability.
Container:
.container
: Center content and set the width to 80% of the viewport, with hidden overflow.
Header:
header
: Style the header with a dark blue background, white text, padding, and a bottom border. Use flexbox to space elements.header h1
: Ensure no top margin for the header title.header nav
: Allow the nav to grow with flexbox and add left margin.header nav ul
: Remove list style, use flexbox to space items, and set link styles..search-bar
: Use flexbox for the search bar layout. Style the input and button with padding, borders, and colors.
Hero Section:
.hero
: Add padding, light gray background, and center text..hero h2
: Add bottom margin for spacing..banners
: Use flexbox to space banners. Style banners and images with margins and rounded corners.
Featured Section:
.featured
: Add padding and white background..featured h2
: Center the title and add bottom margin..products
: Use flexbox to space products. Style products and images with margins and rounded corners.
Footer:
footer
: Add padding, dark blue background, white text, and center text.
Responsive Design:
- Adjust
.container
width to 90% on smaller screens. - Stack navigation items vertically and add bottom margins.
- Stack banners and products vertically and add bottom margins.
- Adjust


Welcome to DevTechTutor.com, your ultimate resource for mastering web development and technology! Whether you're a beginner eager to dive into coding or an experienced developer looking to sharpen your skills, DevTechTutor.com is here to guide you every step of the way. Our mission is to make learning web development accessible, engaging, and effective.