<!DOCTYPE html>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- font awesome cdn link -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<!-- js file link -->
<!-- calling function while page loads -->
<body onload="showPrice()">
.button {
background-color: #27ae60;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
<!-- creating a button and linkning it back to homepage -->
<a href="homepage.html" class="button">Homepage
</a>
<img style="float: right; height: 160px; width: 190px;" src="Logo.png" class="right-align">
<!-- adding a heading which says products on sale-->
<h3 class="title"> Products On Sale
</h3>
<div class="products-container">
<div class="product" data-name="p-1">
<!-- adding an image and centering it -->
<img src="surfacelaptop4.webp" alt="" class="center">
<!-- adding the laptop name -->
<h3>Surface Laptop 4
</h3>
<!-- adding the laptop price -->
<div class="price">$1199.00
</div>
<!-- adding info about the laptop -->
<p style="font-size: 20px; font-family: 'Nunito"> 13.5” AMD Ryzen™ 5 Microsoft Surface® Edition processor –
up to 19 hours, 15” AMD Ryzen™ 7 Microsoft Surface® Edition processor – up to 17.5 hours, 13.5” Intel®
Core™ i5 – up to 17 hours, 15” Intel® Core™ i7 – up to 16.5 hours.
</p>
<div class="product" data-name="p-2">
<!-- adding an image and centering it -->
<img src="Aceraspire3.webp" alt="" class="center">
<!-- adding the laptop name -->
<!-- adding the laptop price -->
<div class="price">$749.99
</div>
<!-- adding info about the laptop -->
<p style="font-size: 20px; font-family: 'Nunito"> Windows 10 Home
Intel® Core™ i3-1115G4 processor Dual-core 3 GHz
Intel® UHD Graphics shared memory
17.3" HD+ (1600 x 900) 16:9
8 GB, DDR4 SDRAM
<div class="product" data-name="p-3">
<!-- adding an image and centering it -->
<img src="Omen 16.png" alt="" class="center">
<!-- adding the laptop name -->
<!-- adding the laptop price -->
<div class="price">$1399.99
</div>
<!-- adding info about the laptop -->
<p style="font-size: 20px; font-family: 'Nunito"> Windows 11 Home
AMD Ryzen™ 7 processor
NVIDIA® GeForce RTX™ 3070 Laptop GPU (8 GB GDDR6 dedicated)
16 GB memory; 512 GB SSD storage
16.1" diagonal FHD display
</p>
<div class="product" data-name="p-4">
<!-- adding an image and centering it -->
<img src="Asuszephrusg14.png" alt="" Class="center">
<!-- adding the laptop name -->
<h3>Asus Zephrus G14
</h3>
<!-- adding the laptop price -->
<div class="price">$1699.99
</div>
<!-- adding info about the laptop -->
<p style="font-size: 20px; font-family: 'Nunito"> NVIDIA GeForce RTX 3050 Ti Laptop GPU 4 GB GDDR6
AMD Ryzen 7 5000 Series 5800HS (2.80GHz)
16GB Memory 512 GB PCIe SSD
14.0" 2560 x 1440 120 Hz, 300 nits, Anti-glare
12.80" x 8.70" x 0.70" 3.50 lbs.
<div class="product" data-name="p-5">
<!-- adding an image and centering it -->
<img src="Hppavillion15.webp" alt="" class="center">
<!-- adding the laptop name -->
<!-- adding the laptop price -->
<div class="price">$1799.99
</div>
<!-- adding info about the laptop -->
<p style="font-size: 20px; font-family: 'Nunito"> Custom 11th Gen Intel Core i7-1165G7 2.80GHz Processor
(upto 4.7 GHz, 12MB Cache, 4-Cores) ; Intel Iris Xe Integrated Graphics, .; 16GB DDR4 SODIMM ; 802.11ac
Wifi, Bluetooth 5.1, 720p HD Webcam, Full Size (10 Key) Keyboard, .; 15.6" Full HD (1920x1080) 60Hz
Touchscreen IPS Display; 45W Power Supply, 3-Cell 41 WHr Battery; 512GB PCIe NVMe SSD.
</p>
<div class="product" data-name="p-6">
<!-- adding an image and centering it -->
<img src="Hpvictus.png" alt="" class="center">
<!-- adding the laptop name -->
<!-- adding the laptop price -->
<div class="price">$899.99
</div>
<!-- adding info about the laptop -->
<p style="font-size: 20px; font-family: 'Nunito"> Up to Intel® Core™ i7-12700H (up to 4.7 GHz with Intel®
Turbo Boost Technology(2g)
Up to a NVIDIA® GeForce RTX™ 3060 Laptop GPU (6 GB GDDR6 dedicated) with DLSS, Ray Tracing and Max-Q
technologies
Up to 32 GB DDR5-4800 MHz RAM (2 x 16 GB)
Up to 1 TB PCIe® Gen4 NVMe™ TLC M.2 SSD
</p>
<div class="product" data-name="p-7">
<!-- adding an image and centering it -->
<img src="msigf65.jpg" alt="" class="center">
<!-- adding the laptop name -->
<!-- adding the laptop price -->
<div class="price">$899.99
</div>
<!-- adding info about the laptop -->
<p style="font-size: 20px; font-family: 'Nunito">15. 6" Fhd (1920*1080), IPS-Level 120Hz thin Bezel
Processor: Core i7-9750h 2. 6 - 4. 5GHz
Graphics : NVIDIA GeForce GTX1660Ti 6G GDDR6
Memory: 16GB (8G*2) DDR4 2666MHz 2 Sockets; Max Memory 64GB
Storage: 512GB NVMe SSD
</p>
<div class="product" data-name="p-8">
<!-- adding an image and centering it -->
<img src="asustuf.jpg" alt="" class="center">
<!-- adding the laptop name -->
<!-- adding the laptop price -->
<div class="price">$1149.00
</div>
<!-- adding info about the laptop -->
<p style="font-size: 20px; font-family: 'Nunito"> NVIDIA GeForce GTX 1650 4 GB GDDR6
Intel Core i5 10th Gen 10300H (2.50GHz)
8GB Memory 1 TB PCIe SSD
15.6" 1920 x 1080 144 Hz, 250 nits, 45% NTSC, anti-glare
14.10" x 10.10" x 1.00" 5.10 lbs.
<div class="product" data-name="p-9">
<!-- adding an image and centering it -->
<img src="razerblade15.png" alt="" class="center">
<!-- adding the laptop name -->
<!-- adding the laptop price -->
<div class="price">$3199.99
</div>
<!-- adding info about the laptop -->
<p style="font-size: 20px; font-family: 'Nunito"> 1.8GHz 14-core Intel i7-12800H processor, Turbo Boost up
to 4.8GHz, with 24MB of Cache
Windows 11 Home – 64 bits
15.6" QHD 240Hz, 100% DCI-P3, G-Sync, 2.5ms, individually factory calibrated
NVIDIA® GeForce RTX™ 3060 (6GB GDDR6 VRAM)
1TB SSD (M.2 NVMe PCIe 4.0 x4)
16 GB DDR5 4800MHz dual-channel memory (slotted)
</p>
<div class="product" data-name="p-10">
<!-- adding an image and centering it -->
<img src="alienwarem15.jpg" alt="" class="center">
<!-- adding the laptop name -->
<!-- adding the laptop price -->
<div class="price">$2099.99
</div>
<!-- adding info about the laptop -->
<p style="font-size: 20px; font-family: 'Nunito"> 2.2 GHz Intel Core i7-8750H Six-Core
16GB DDR4 RAM | 512GB PCIe M.2 SSD
15.6" 1920 x 1080 Anti-Glare IPS Display
NVIDIA GeForce RTX 2060 (6GB GDDR6)
Wi-Fi 5 (802.11ac) | Bluetooth 5.0
Gigabit Ethernet Port USB 3.1 Gen 1 Type-A
Thunderbolt 3 | HDMI 2.0b | Mini DP 1.3
1080p Webcam, Dual-Array Mics, Speakers
Windows 10 Home (64-Bit)
</p>
<center>
<!-- making a button so that the user can select the laptops they would like to purchase -->
<select id="product" class="button">
<!-- making a button so that the user can select the quantity of the laptops they would like -->
<select id="quantity" class="button">
<!-- creating an add to cart and linking the js function on the onclick -->
<button class="button" onclick="addToCart()">Add to Cart
</button>
</center>
* {
font-family: 'Nunito', sans-serif;
margin: 0;
padding: 0;
box-sizing: border-box;
outline: none;
border: none;
text-decoration: none;
transition: all .2s linear;
text-transform: capitalize;
}
html {
font-size: 62.5%;
overflow-x: hidden;
}
body {
background: #eee;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 3rem 2rem;
}
.container .title {
font-size: 3.5rem;
color: #444;
margin-bottom: 3rem;
text-transform: uppercase;
text-align: center;
}
.container .products-container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr));
gap: 2rem;
}
.container .products-container .product {
text-align: center;
padding: 3rem 2rem;
background: #fff;
box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .1);
outline: .1rem solid #ccc;
outline-offset: -1.5rem;
cursor: pointer;
}
.container .products-container .product:hover {
outline: .2rem solid #222;
outline-offset: 0;
}
.container .products-container .product img {
height: 25rem;
}
.container .products-container .product:hover img {
transform: scale(.9);
}
.container .products-container .product h3 {
padding: .5rem 0;
font-size: 2rem;
color: #444;
}
.container .products-container .product:hover h3 {
color: #27ae60;
}
.container .products-container .product .price {
font-size: 2rem;
color: #444;
}
.products-preview {
position: fixed;
top: 0;
left: 0;
min-height: 100vh;
width: 100%;
background: rgba(0, 0, 0, .8);
display: none;
align-items: center;
justify-content: center;
}
.products-preview .preview {
display: none;
padding: 2rem;
text-align: center;
background: #fff;
position: relative;
margin: 2rem;
width: 40rem;
}
.products-preview .preview.active {
display: inline-block;
}
.products-preview .preview img {
height: 30rem;
}
.products-preview .preview .fa-times {
position: absolute;
top: 1rem;
right: 1.5rem;
cursor: pointer;
color: #444;
font-size: 4rem;
}
.products-preview .preview .fa-times:hover {
transform: rotate(90deg);
}
.products-preview .preview h3 {
color: #444;
padding: .5rem 0;
font-size: 2.5rem;
}
.products-preview .preview .stars {
padding: 1rem 0;
font-size: 1.7rem;
}
.products-preview .preview .stars i {
color: #27ae60;
}
.products-preview .preview .stars span {
color: #999;
}
.products-preview .preview p {
line-height: 1.5;
padding: 1rem 0;
font-size: 1.6rem;
color: #777;
}
.products-preview .preview .price {
padding: 1rem 0;
font-size: 2.5rem;
color: #27ae60;
}
.products-preview .preview .buttons {
display: flex;
gap: 1.5rem;
flex-wrap: wrap;
margin-top: 1rem;
}
.products-preview .preview .buttons a {
flex: 1 1 16rem;
padding: 1rem;
font-size: 1.8rem;
color: #444;
border: .1rem solid #444;
}
.products-preview .preview .buttons a.cart {
background: #444;
color: #fff;
}
.products-preview .preview .buttons a.cart:hover {
background: #111;
}
.products-preview .preview .buttons a.buy:hover {
background: #444;
color: #fff;
}
#purchase{
visibility: visible;
}
#purchase .active{
visibility: hidden;
}
@media (max-width:991px) {
html {
font-size: 55%;
}
}
@media (max-width:768px) {
.products-preview .preview img {
height: 25rem;
}
}
@media (max-width:450px) {
html {
font-size: 50%;
}
}
.center {
display: block;
margin-left: auto;
margin-right: auto;
width: 100%;
}