使用html和css帮我写一个个人中心页面含有个人资料
时间: 2023-06-12 12:06:21 浏览: 66
好的,以下是一个简单的个人中心页面示例,包含个人资料信息:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>个人中心</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
}
header {
background-color: #333;
color: #fff;
padding: 20px;
text-align: center;
}
h1 {
margin: 0;
font-size: 36px;
}
section {
display: flex;
flex-wrap: wrap;
padding: 20px;
}
section div {
flex: 1;
margin: 10px;
padding: 20px;
background-color: #eee;
border-radius: 10px;
}
section div h2 {
margin-top: 0;
font-size: 24px;
}
section div p {
margin: 10px 0;
font-size: 18px;
}
section div label {
display: block;
margin-bottom: 10px;
font-size: 18px;
font-weight: bold;
}
section div input[type="text"],
section div input[type="email"] {
width: 100%;
padding: 10px;
border-radius: 5px;
border: none;
margin-bottom: 10px;
font-size: 18px;
box-sizing: border-box;
}
section div button {
background-color: #333;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 5px;
font-size: 18px;
cursor: pointer;
transition: background-color 0.3s ease;
}
section div button:hover {
background-color: #555;
}
</style>
</head>
<body>
<header>
<h1>个人中心</h1>
</header>
<section>
<div>
<h2>个人资料</h2>
<form>
<label for="name">姓名</label>
<input type="text" id="name" name="name" value="张三">
<label for="email">邮箱</label>
<input type="email" id="email" name="email" value="zhangsan@example.com">
<button type="submit">保存</button>
</form>
</div>
</section>
</body>
</html>
```
上述代码中,使用了 HTML 和 CSS 实现了一个简单的个人中心页面,包含了一个个人资料信息的模块,用户可以在这里输入姓名和邮箱,点击“保存”按钮进行保存。你可以根据自己的需求进行修改和扩展。