cart.jsp
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Shopping Cart - Online Grocery</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #e6ffee;
color: #333;
margin: 0;
padding: 0;
}
.container {
width: 80%;
margin: 20px auto;
background-color: #ffffff;
border-radius: 8px;
padding: 20px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
h2 {
text-align: center;
color: #2e8b57;
}
table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
}
table, th, td {
border: 1px solid #c0c0c0;
}
th, td {
padding: 12px;
text-align: center;
}
th {
background-color: #2e8b57;
color: white;
}
td {
background-color: #f9fff9;
}
input[type="number"] {
width: 50px;
padding: 5px;
border: 1px solid #c0c0c0;
border-radius: 4px;
text-align: center;
}
.btn {
background-color: #2e8b57;
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
.btn:hover {
background-color: #276749;
}
.remove-link {
color: #2e8b57;
text-decoration: none;
font-weight: bold;
cursor: pointer;
transition: color 0.3s;
}
.remove-link:hover {
color: #276749;
}
.total-row {
font-weight: bold;
}
.checkout-btn {
background-color: #2e8b57;
color: white;
padding: 15px 30px;
border: none;
border-radius: 5px;
cursor: pointer;
display: block;
width: 100%;
margin-top: 20px;
transition: background-color 0.3s;
}
.checkout-btn:hover {
background-color: #276749;
}
</style>
</head>
<body>
<header>
<h1>Checkout</h1>
<nav>
<a href="home.jsp">Home</a>
<a href="cart.jsp">Cart</a>
<a href="products.jsp">Products</a>
</nav>
</header>
<br><br>
<div class="container">
<h2>Your Shopping Cart</h2>
<table>
<thead>
<tr>
<th>Item</th>
<th>Price</th>
<th>Quantity</th>
<th>Total</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr>
<td>Apples</td>
<td>$1.50</td>
<td><input type="number" value="2" min="1"></td>
<td>$3.00</td>
<td><a class="remove-link" href="#">Remove</a></td>
</tr>
<tr>
<td>Bananas</td>
<td>$0.75</td>
<td><input type="number" value="5" min="1"></td>
<td>$3.75</td>
<td><a class="remove-link" href="#">Remove</a></td>
</tr>
<tr>
<td>Carrots</td>
<td>$0.90</td>
<td><input type="number" value="3" min="1"></td>
<td>$2.70</td>
<td><a class="remove-link" href="#">Remove</a></td>
</tr>
<tr class="total-row">
<td colspan="3">Total:</td>
<td colspan="2">$9.45</td>
</tr>
</tbody>
</table>
<button class="checkout-btn">Proceed to Checkout</button>
</div>
</body>
</html>
Comments
Post a Comment