电商
时间: 2023-11-16 10:06:52 浏览: 37
好的,下面是一个简单的电商首页的HTML代码,您可以根据需要进行修改和完善:
```html
<!DOCTYPE html>
<html>
<head>
<title>电商首页</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/* 样式表 */
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
.header {
background-color: #333;
color: #fff;
padding: 20px;
text-align: center;
font-size: 24px;
}
.menu {
background-color: #f2f2f2;
padding: 10px;
text-align: center;
font-size: 18px;
}
.menu a {
color: #333;
text-decoration: none;
margin-right: 20px;
}
.menu a:hover {
color: #666;
}
.banner {
background-image: url("banner.jpg");
background-size: cover;
height: 400px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #fff;
text-align: center;
font-size: 36px;
}
.products {
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
padding: 20px;
background-color: #fff;
}
.product {
width: 300px;
margin: 20px;
padding: 10px;
border: 1px solid #ccc;
box-shadow: 2px 2px 2px #ccc;
text-align: center;
font-size: 18px;
}
.product img {
max-width: 100%;
height: auto;
margin-bottom: 10px;
}
.product h3 {
margin: 0;
font-size: 24px;
}
.product p {
margin: 10px 0;
font-size: 18px;
}
.footer {
background-color: #333;
color: #fff;
padding: 20px;
text-align: center;
font-size: 18px;
}
</style>
</head>
<body>
<header class="header">
<h1>电商首页</h1>
</header>
<nav class="menu">
<a href="#">首页</a>
<a href="#">新品上市</a>
<a href="#">热门商品</a>
<a href="#">特价促销</a>
<a href="#">关于我们</a>
</nav>
<div class="banner">
<h2>欢迎来到我们的电商网站</h2>
<p>购物从未如此简单和便捷</p>
<button>立即购买</button>
</div>
<main class="products">
<div class="product">
<img src="product1.jpg" alt="商品1">
<h3>商品1</h3>
<p>价格:100元</p>
<button>立即购买</button>
</div>
<div class="product">
<img src="product2.jpg" alt="商品2">
<h3>商品2</h3>
<p>价格:200元</p>
<button>立即购买</button>
</div>
<div class="product">
<img src="product3.jpg" alt="商品3">
<h3>商品3</h3>
<p>价格:300元</p>
<button>立即购买</button>
</div>
<div class="product">
<img src="product4.jpg" alt="商品4">
<h3>商品4</h3>
<p>价格:400元</p>
<button>立即购买</button>
</div>
<div class="product">
<img src="product5.jpg" alt="商品5">
<h3>商品5</h3>
<p>价格:500元</p>
<button>立即购买</button>
</div>
<div class="product">
<img src="product6.jpg" alt="商品6">
<h3>商品6</h3>
<p>价格:600元</p>
<button>立即购买</button>
</div>
</main>
<footer class="footer">
<p>版权所有 © 2021 电商网站</p>
</footer>
</body>
</html>
```
这个电商首页包括了一个头部、菜单、轮播图、商品展示和底部版权信息,您可以根据需要进行修改和扩展。