HTML css 个人中心分模块
时间: 2023-08-05 19:57:29 浏览: 48
好的,您可以将个人中心的不同功能分别封装成不同的模块,以下是一些示例代码:
HTML:
```
<div class="container">
<div class="module personal-info">
<!-- 个人信息模块 -->
<h2>个人信息</h2>
<form>
<label for="username">用户名:</label>
<input type="text" id="username">
<label for="email">邮箱:</label>
<input type="email" id="email">
<button type="submit">保存</button>
</form>
</div>
<div class="module change-password">
<!-- 修改密码模块 -->
<h2>修改密码</h2>
<form>
<label for="old-password">旧密码:</label>
<input type="password" id="old-password">
<label for="new-password">新密码:</label>
<input type="password" id="new-password">
<label for="confirm-password">确认密码:</label>
<input type="password" id="confirm-password">
<button type="submit">保存</button>
</form>
</div>
<div class="module bind-phone">
<!-- 绑定手机模块 -->
<h2>绑定手机</h2>
<form>
<label for="phone">手机号:</label>
<input type="tel" id="phone">
<button type="submit">保存</button>
</form>
</div>
<div class="module my-messages">
<!-- 我的消息模块 -->
<h2>我的消息</h2>
<ul>
<li><a href="#">系统消息1</a></li>
<li><a href="#">系统消息2</a></li>
<li><a href="#">好友消息1</a></li>
<li><a href="#">好友消息2</a></li>
</ul>
</div>
</div>
```
CSS:
```
.container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.module {
width: calc(25% - 20px);
margin-bottom: 20px;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
}
@media (max-width: 768px) {
.module {
width: calc(50% - 20px);
}
}
@media (max-width: 480px) {
.module {
width: 100%;
}
}
```
以上是一个简单的示例代码,您可以根据实际情况进行修改和扩展。希望能对您有所帮助!
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)