帮我写一个好看的购物车页面的html代码
时间: 2023-08-04 13:09:33 浏览: 47
当然可以!以下是一个简单的购物车页面的HTML代码,你可以根据需要进行修改和美化:
```
<!DOCTYPE html>
<html>
<head>
<title>购物车页面</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: Arial, sans-serif;
background-color: #f7f7f7;
padding: 20px;
}
h1 {
text-align: center;
color: #333;
margin-bottom: 20px;
}
table {
width: 100%;
border-collapse: collapse;
background-color: #fff;
box-shadow: 1px 2px 3px rgba(0,0,0,0.1);
margin-bottom: 20px;
}
th, td {
padding: 15px;
text-align: left;
border-bottom: 1px solid #ddd;
}
th {
background-color: #333;
color: #fff;
font-size: 18px;
}
td {
font-size: 16px;
}
.total {
font-size: 20px;
font-weight: bold;
text-align: right;
margin-bottom: 20px;
}
.btn {
display: inline-block;
background-color: #333;
color: #fff;
padding: 10px 20px;
border-radius: 4px;
text-decoration: none;
margin-right: 10px;
transition: background-color 0.2s;
}
.btn:hover {
background-color: #555;
}
</style>
</head>
<body>
<h1>购物车</h1>
<table>
<thead>
<tr>
<th>商品</th>
<th>单价</th>
<th>数量</th>
<th>小计</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr>
<td>商品名称</td>
<td>10.00元</td>
<td>1</td>
<td>10.00元</td>
<td><a href="#">删除</a></td>
</tr>
<tr>
<td>商品名称</td>
<td>20.00元</td>
<td>2</td>
<td>40.00元</td>
<td><a href="#">删除</a></td>
</tr>
<tr>
<td>商品名称</td>
<td>30.00元</td>
<td>1</td>
<td>30.00元</td>
<td><a href="#">删除</a></td>
</tr>
</tbody>
</table>
<div class="total">总计:80.00元</div>
<a href="#" class="btn">继续购物</a>
<a href="#" class="btn">结算</a>
</body>
</html>
```