商品专栏网页制作代码
时间: 2023-07-04 07:08:35 浏览: 180
以下是一个简单的商品专栏网页制作代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>商品专栏</title>
<style type="text/css">
body {
font-family: Arial, sans-serif;
background-color: #f2f2f2;
}
h1 {
text-align: center;
margin-top: 50px;
color: #333;
}
.container {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin-top: 50px;
}
.item {
width: 300px;
margin: 20px;
padding: 20px;
border: 1px solid #ccc;
background-color: #fff;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
transition: box-shadow 0.3s ease;
}
.item:hover {
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
.item img {
display: block;
margin: 0 auto;
max-width: 100%;
height: auto;
}
.item h2 {
margin-top: 20px;
color: #333;
font-size: 24px;
text-align: center;
}
.item p {
margin-top: 10px;
font-size: 16px;
line-height: 1.5;
text-align: justify;
}
.item .price {
margin-top: 20px;
text-align: center;
color: #f00;
font-size: 24px;
font-weight: bold;
}
</style>
</head>
<body>
<h1>商品专栏</h1>
<div class="container">
<div class="item">
<img src="item1.jpg" alt="商品1">
<h2>商品1名称</h2>
<p>商品1描述Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget enim non dolor malesuada accumsan. Donec varius lacus non dui tincidunt imperdiet.</p>
<div class="price">¥99.99</div>
</div>
<div class="item">
<img src="item2.jpg" alt="商品2">
<h2>商品2名称</h2>
<p>商品2描述Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget enim non dolor malesuada accumsan. Donec varius lacus non dui tincidunt imperdiet.</p>
<div class="price">¥199.99</div>
</div>
<div class="item">
<img src="item3.jpg" alt="商品3">
<h2>商品3名称</h2>
<p>商品3描述Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget enim non dolor malesuada accumsan. Donec varius lacus non dui tincidunt imperdiet.</p>
<div class="price">¥299.99</div>
</div>
</div>
</body>
</html>
```
你可以在 `img` 标签中替换相应的图片路径,修改商品名称、描述和价格等内容。同时,你也可以添加更多的商品信息来完善你的商品专栏页面。
阅读全文