用html5和css3做一个京东商品页面
时间: 2023-06-16 21:07:10 浏览: 229
好的,下面是一个简单的京东商品页面示例,仅供参考:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>京东商品页面</title>
<style>
/* Reset styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* General styles */
body {
font-family: Arial, sans-serif;
font-size: 14px;
line-height: 1.5;
background-color: #f5f5f5;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
h1 {
font-size: 24px;
font-weight: bold;
margin-bottom: 10px;
}
.product {
display: flex;
flex-wrap: wrap;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 5px;
overflow: hidden;
}
.product-image {
flex: 0 0 50%;
max-width: 50%;
height: 400px;
background-image: url('https://img14.360buyimg.com/n1/s450x450_jfs/t1/168625/28/10522/287243/606f7f08E9d27a6f7/4e478b12eb9a9e6c.jpg');
background-size: cover;
background-position: center;
}
.product-details {
flex: 1 1 50%;
max-width: 50%;
padding: 20px;
}
.product-title {
font-size: 18px;
font-weight: bold;
margin-bottom: 10px;
}
.product-price {
font-size: 24px;
color: #c00;
margin-bottom: 20px;
}
.product-description {
font-size: 14px;
line-height: 1.5;
margin-bottom: 20px;
}
.product-features {
font-size: 14px;
line-height: 1.5;
margin-bottom: 20px;
}
.product-add-to-cart {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.product-add-to-cart label {
font-size: 14px;
margin-right: 10px;
}
.product-add-to-cart input[type='number'] {
width: 50px;
height: 30px;
border: 1px solid #ddd;
border-radius: 3px;
padding: 5px;
}
.product-add-to-cart button {
background-color: #c00;
color: #fff;
border: none;
border-radius: 3px;
padding: 10px 20px;
cursor: pointer;
}
</style>
</head>
<body>
<div class="container">
<h1>京东商品页面</h1>
<div class="product">
<div class="product-image"></div>
<div class="product-details">
<div class="product-title">小米手环6NFC</div>
<div class="product-price">¥229</div>
<div class="product-description">小米手环6NFC,智能健康小助手,支持NFC智能支付,全新AMOLED屏幕,更清晰、更灵敏,全天候健康监测,每天更好的健康习惯,超长续航,7天待机</div>
<div class="product-features">
<ul>
<li>全新AMOLED屏幕,更清晰、更灵敏</li>
<li>支持NFC智能支付</li>
<li>全天候健康监测</li>
<li>超长续航,7天待机</li>
</ul>
</div>
<div class="product-add-to-cart">
<label for="quantity">数量:</label>
<input type="number" id="quantity" name="quantity" min="1" max="10" value="1">
<button>加入购物车</button>
</div>
</div>
</div>
</div>
</body>
</html>
```
在浏览器中打开该 HTML 文件,就可以看到一个简单的京东商品页面了。
阅读全文