商品展示页面html模板
时间: 2023-06-30 14:12:11 浏览: 128
以下是一个简单的商品展示页面的HTML模板,可以根据需要进行修改和扩展:
```html
<!DOCTYPE html>
<html>
<head>
<title>商品展示页面</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
/* 页面样式 */
body {
font-family: Arial, sans-serif;
background-color: #f5f5f5;
margin: 0;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
box-sizing: border-box;
}
.product {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.product-item {
width: calc(100% / 3 - 20px);
margin-bottom: 20px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 0 5px rgba(0,0,0,.1);
overflow: hidden;
}
.product-item img {
width: 100%;
height: auto;
}
.product-item .title {
font-size: 16px;
line-height: 1.5;
padding: 10px;
box-sizing: border-box;
text-align: center;
}
.product-item .price {
font-size: 20px;
font-weight: bold;
padding: 10px;
box-sizing: border-box;
text-align: center;
color: #f00;
}
</style>
</head>
<body>
<div class="container">
<h1>商品展示</h1>
<div class="product">
<div class="product-item">
<img src="product1.jpg" alt="商品1">
<div class="title">商品1</div>
<div class="price">¥99.00</div>
</div>
<div class="product-item">
<img src="product2.jpg" alt="商品2">
<div class="title">商品2</div>
<div class="price">¥199.00</div>
</div>
<div class="product-item">
<img src="product3.jpg" alt="商品3">
<div class="title">商品3</div>
<div class="price">¥299.00</div>
</div>
<!-- 添加更多商品 -->
</div>
</div>
</body>
</html>
```
以上代码实现了一个简单的商品展示页面,包含了商品图片、标题和价格。可以根据需要添加更多商品和样式。