h5编写一个用户界面,有头像,用户名,昵称,邮箱,电话号码,
时间: 2024-04-29 11:24:14 浏览: 5
密码等信息输入框和保存按钮。
```html
<!DOCTYPE html>
<html>
<head>
<title>User Profile</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: #f2f2f2;
margin: 0;
padding: 0;
}
.container {
max-width: 500px;
margin: 0 auto;
background-color: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
h1 {
text-align: center;
}
label {
display: block;
margin-bottom: 5px;
font-weight: 600;
}
input[type="text"], input[type="email"], input[type="tel"], input[type="password"] {
width: 100%;
padding: 10px;
border-radius: 5px;
border: 1px solid #ccc;
margin-bottom: 20px;
font-size: 16px;
}
input[type="submit"] {
background-color: #4CAF50;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
float: right;
}
img {
display: block;
margin: 0 auto;
border-radius: 50%;
width: 150px;
height: 150px;
object-fit: cover;
object-position: center;
margin-bottom: 20px;
}
</style>
</head>
<body>
<div class="container">
<h1>User Profile</h1>
<img src="https://via.placeholder.com/150" alt="User Avatar">
<label for="username">Username</label>
<input type="text" id="username" name="username" placeholder="Enter your username">
<label for="nickname">Nickname</label>
<input type="text" id="nickname" name="nickname" placeholder="Enter your nickname">
<label for="email">Email</label>
<input type="email" id="email" name="email" placeholder="Enter your email">
<label for="phone">Phone</label>
<input type="tel" id="phone" name="phone" placeholder="Enter your phone number">
<label for="password">Password</label>
<input type="password" id="password" name="password" placeholder="Enter your password">
<input type="submit" value="Save">
</div>
</body>
</html>
```