<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>現代購物網站</title>
<style>
body {
font-family: 'Arial', sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
.navbar {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #333;
color: white;
padding: 15px 30px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.navbar .logo {
font-size: 24px;
font-weight: bold;
}
.navbar .search-box {
flex: 1;
margin: 0 20px;
position: relative;
}
.navbar input[type="search"] {
width: 100%;
padding: 10px;
border: none;
border-radius: 25px;
outline: none;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.navbar button {
background-color: #ff6f61;
border: none;
color: white;
padding: 10px 20px;
border-radius: 25px;
cursor: pointer;
transition: background-color 0.3s;
}
.navbar button:hover {
background-color: #ff3b30;
}
.hero {
background-image: url('<https://via.placeholder.com/1600x600>');
background-size: cover;
background-position: center;
color: white;
text-align: center;
padding: 100px 20px;
box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0.5);
}
.hero h1 {
font-size: 48px;
margin: 0;
}
.hero p {
font-size: 24px;
margin: 20px 0;
}
.hero button {
background-color: #ff6f61;
border: none;
color: white;
padding: 15px 30px;
border-radius: 25px;
cursor: pointer;
font-size: 18px;
transition: background-color 0.3s;
}
.hero button:hover {
background-color: #ff3b30;
}
.products {
display: flex;
flex-wrap: wrap;
justify-content: center;
padding: 20px;
}
.product-card {
background-color: white;
border-radius: 15px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
margin: 15px;
overflow: hidden;
width: 300px;
text-align: center;
transition: transform 0.3s;
}
.product-card:hover {
transform: translateY(-10px);
}
.product-card img {
width: 100%;
height: 200px;
object-fit: cover;
}
.product-card h3 {
margin: 15px 0;
font-size: 22px;
}
.product-card p {
color: #ff6f61;
font-size: 20px;
margin: 0 0 15px;
}
.product-card button {
background-color: #ff6f61;
border: none;
color: white;
padding: 10px 20px;
border-radius: 25px;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s;
}
.product-card button:hover {
background-color: #ff3b30;
}
.cart {
padding: 20px;
background-color: #fff;
border-radius: 15px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.cart h2 {
margin: 0 0 20px;
font-size: 24px;
}
.cart-items {
list-style: none;
padding: 0;
margin: 0;
}
.cart-items li {
border-bottom: 1px solid #ddd;
padding: 10px 0;
display: flex;
justify-content: space-between;
}
.cart-items span {
font-size: 18px;
}
.cart-total {
text-align: right;
font-size: 20px;
margin-top: 20px;
font-weight: bold;
}
.footer {
background-color: #333;
color: white;
text-align: center;
padding: 20px;
position: relative;
bottom: 0;
width: 100%;
}
</style>
</head>
<body>
<div class="navbar">
<div class="logo">Shopify</div>
<div class="search-box">
<input type="search" placeholder="搜尋商品...">
</div>
<button>登錄</button>
</div>
<div class="hero">
<h1>發現你的完美商品</h1>
<p>探索我們精選的商品和特惠活動,開始購物之旅吧!</p>
<button>立即購物</button>
</div>
<div class="products">
<div class="product-card">
<img src="<https://via.placeholder.com/300x200>" alt="商品1">
<h3>商品名稱1</h3>
<p>$49.99</p>
<button>加入購物車</button>
</div>
<div class="product-card">
<img src="<https://via.placeholder.com/300x200>" alt="商品2">
<h3>商品名稱2</h3>
<p>$39.99</p>
<button>加入購物車</button>
</div>
<div class="product-card">
<img src="<https://via.placeholder.com/300x200>" alt="商品3">
<h3>商品名稱3</h3>
<p>$29.99</p>
<button>加入購物車</button>
</div>
<!-- 可以添加更多商品卡片 -->
</div>
<div class="cart">
<h2>購物車</h2>
<ul class="cart-items">
<li>
<span>商品名稱1</span>
<span>$49.99</span>
</li>
<li>
<span>商品名稱2</span>
<span>$39.99</span>
</li>
</ul>
<div class="cart-total">
總計: $89.98
</div>
</div>
<div class="footer">
© 2024 Shopify. All rights reserved.
</div>
</body>
</html>