写一个登录注册界面html
时间: 2023-07-18 12:46:34 浏览: 46
好的,以下是一个简单的登录注册界面的HTML代码:
```
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录/注册</title>
<style>
.container {
max-width: 500px;
margin: auto;
text-align: center;
}
input[type=text], input[type=password], input[type=email] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
button {
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
}
button:hover {
opacity: 0.8;
}
.cancelbtn {
width: auto;
padding: 10px 18px;
background-color: #f44336;
}
.imgcontainer {
text-align: center;
margin: 24px 0 12px 0;
position: relative;
}
img.avatar {
width: 40%;
border-radius: 50%;
}
.container {
padding: 16px;
}
span.psw {
float: right;
padding-top: 16px;
}
</style>
</head>
<body>
<h2>登录/注册</h2>
<div class="container">
<form action="/login" method="post">
<div class="imgcontainer">
<img src="avatar.png" alt="Avatar" class="avatar">
</div>
<label for="email"><b>邮箱</b></label>
<input type="email" placeholder="请输入邮箱" name="email" required>
<label for="password"><b>密码</b></label>
<input type="password" placeholder="请输入密码" name="password" required>
<button type="submit">登录</button>
<label>
<input type="checkbox" checked="checked" name="remember"> 记住我
</label>
</form>
<form action="/register" method="post">
<div class="imgcontainer">
<img src="avatar.png" alt="Avatar" class="avatar">
</div>
<label for="name"><b>用户名</b></label>
<input type="text" placeholder="请输入用户名" name="name" required>
<label for="email"><b>邮箱</b></label>
<input type="email" placeholder="请输入邮箱" name="email" required>
<label for="password"><b>密码</b></label>
<input type="password" placeholder="请输入密码" name="password" required>
<button type="submit">注册</button>
</form>
</div>
</body>
</html>
```
你可以将上述代码复制到一个HTML文件中,然后使用浏览器打开该文件,即可看到一个简单的登录注册界面。当然,具体的样式和功能可以根据实际需求进行修改和完善。