Cart
Cart
Index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cart</title>
<link rel="stylesheet" href="cart-style.css">
</head>
<body>
<div class="container">
<h1>Your Cart</h1>
<div id="cart-item" class="cart-item">
<!-- Book information will be dynamically injected here -->
</div>
<button class="checkout-btn">Checkout</button>
</div>
<script>
// Book data
const books = {
'quantum Physics': {
img: 'https://media.springernature.com/full/springer-static/cover-hires/book/
978-3-031-23717-1',
price: '$15.99'
},
'C programming: {
img: 'https://media.springernature.com/full/springer-static/cover-hires/book/
978-1-4842-5725-8',
price: '$20.99'
},
'DS & algo': {
img: 'https://5.imimg.com/data5/SELLER/Default/2022/3/WZ/EL/NM/147304712/
whatsapp-image-2022-02-20-at-5-05-41-pm.jpeg',
price: '$12.99'
}
};
body {
font-family: 'Arial', sans-serif;
background-color: #f9f9f9;
padding: 20px;
}
h1 {
text-align: center;
margin-bottom: 20px;
font-size: 2em;
color: #333;
}
.cart-item img {
width: 120px;
height: 180px;
object- t: cover;
border-radius: 5px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
margin-bottom: 15px;
}
.cart-item h3 {
margin: 10px 0;
color: #333;
font-size: 1.5em;
}
.cart-item p {
color: #555;
font-size: 1.2em;
fl
fi
fl
}
.checkout-btn:hover {
background-color: #0056b3;
}
.cart-item img {
width: 90px;
height: 135px;
}
.checkout-btn {
padding: 10px 20px;
font-size: 16px;
}
}