-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecomerce.html
More file actions
104 lines (94 loc) · 2.65 KB
/
ecomerce.html
File metadata and controls
104 lines (94 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simple E-Commerce Template</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
header {
background-color: #333;
color: white;
padding: 10px 20px;
}
nav ul {
list-style-type: none;
padding: 0;
}
nav ul li {
display: inline;
margin-right: 20px;
}
nav ul li a {
color: white;
text-decoration: none;
}
.product-list {
display: flex;
justify-content: space-around;
padding: 20px;
}
.product {
border: 1px solid #ccc;
padding: 10px;
text-align: center;
}
footer {
text-align: center;
padding: 10px;
background-color: #333;
color: white;
position: relative;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<header>
<h1>My E-Commerce Store</h1>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</header>
<main>
<section class="product-list">
<div class="product">
<img src="https://via.placeholder.com/150" alt="Product 1">
<h2>Product 1</h2>
<p>$10.00</p>
<button onclick="addToCart('Product 1', 10)">Add to Cart</button>
</div>
<div class="product">
<img src="https://via.placeholder.com/150" alt="Product 2">
<h2>Product 2</h2>
<p>$15.00</p>
<button onclick="addToCart('Product 2', 15)">Add to Cart</button>
</div>
<div class="product">
<img src="https://via.placeholder.com/150" alt="Product 3">
<h2>Product 3</h2>
<p>$20.00</p>
<button onclick="addToCart('Product 3', 20)">Add to Cart</button>
</div>
</section>
</main>
<footer>
<p>© 2023 My E-Commerce Store</p>
</footer>
<script>
function addToCart(productName, price) {
alert(`${productName} has been added to your cart for $${price}.`);
}
</script>
</body>
</html>