帮我写一个个人中心的页面
时间: 2023-09-13 17:08:27 浏览: 42
好的,以下是一个基本的个人中心页面的示例代码:
```html
<!DOCTYPE html>
<html>
<head>
<title>个人中心</title>
<style>
/* 样式表 */
body {
font-family: Arial, sans-serif;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
h1 {
font-size: 36px;
margin-bottom: 20px;
}
h2 {
font-size: 24px;
margin-bottom: 10px;
}
.profile {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.profile img {
width: 100px;
height: 100px;
border-radius: 50%;
margin-right: 20px;
}
.profile h3 {
font-size: 28px;
margin: 0;
}
.profile p {
margin: 0;
font-size: 18px;
}
.edit-profile-btn {
display: inline-block;
background-color: #007bff;
color: #fff;
padding: 10px 20px;
border-radius: 5px;
text-decoration: none;
margin-left: 20px;
transition: background-color 0.2s ease-in-out;
}
.edit-profile-btn:hover {
background-color: #0062cc;
}
.section {
margin-bottom: 40px;
border-bottom: 1px solid #ccc;
padding-bottom: 20px;
}
.section h2 {
margin-top: 0;
}
.section ul {
list-style: none;
margin: 0;
padding: 0;
}
.section li {
display: flex;
align-items: center;
margin-bottom: 10px;
}
.section li img {
width: 50px;
height: 50px;
border-radius: 50%;
margin-right: 10px;
}
.section li p {
margin: 0;
font-size: 18px;
}
</style>
</head>
<body>
<div class="container">
<h1>个人中心</h1>
<div class="profile">
<img src="https://via.placeholder.com/100x100" alt="头像">
<div>
<h3>用户名</h3>
<p>邮箱地址</p>
</div>
<a href="#" class="edit-profile-btn">编辑个人资料</a>
</div>
<div class="section">
<h2>我的订单</h2>
<ul>
<li>
<img src="https://via.placeholder.com/50x50" alt="商品图片">
<p>商品名称</p>
</li>
<li>
<img src="https://via.placeholder.com/50x50" alt="商品图片">
<p>商品名称</p>
</li>
</ul>
</div>
<div class="section">
<h2>我的收藏</h2>
<ul>
<li>
<img src="https://via.placeholder.com/50x50" alt="商品图片">
<p>商品名称</p>
</li>
<li>
<img src="https://via.placeholder.com/50x50" alt="商品图片">
<p>商品名称</p>
</li>
</ul>
</div>
</div>
</body>
</html>
```
这个页面包括了一个用户资料区域和两个列表,分别展示用户的订单和收藏。你可以根据自己的需求调整内容和样式。