请帮我写一个html的前端登录注册页面
时间: 2023-03-29 18:03:08 浏览: 48
好的,我可以为您提供一个基本的前端登录注册页面。以下是代码:
<!DOCTYPE html>
<html>
<head>
<title>Login/Register Page</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.">
<style>
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
}
.container {
margin: auto;
max-width: 500px;
padding: 20px;
background-color: #fff;
border-radius: 5px;
box-shadow: 10px rgba(,,,.3);
}
h1 {
text-align: center;
margin-bottom: 30px;
}
input[type=text], input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px ;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
button {
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px ;
border: none;
border-radius: 4px;
cursor: pointer;
width: 100%;
}
button:hover {
background-color: #45a049;
}
.cancelbtn {
width: auto;
padding: 10px 18px;
background-color: #f44336;
}
.imgcontainer {
text-align: center;
margin: 24px 12px ;
position: relative;
}
img.avatar {
width: 40%;
border-radius: 50%;
}
.container > p {
text-align: center;
}
span.psw {
float: right;
padding-top: 16px;
}
@media screen and (max-width: 600px) {
.container {
max-width: 100%;
}
}
</style>
</head>
<body>
<div class="container">
<h1>Login/Register</h1>
<form action="#" method="post">
<div class="imgcontainer">
<img src="avatar.png" alt="Avatar" class="avatar">
</div>
<label for="username"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="username" required>
<label for="password"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="password" required>
<button type="submit">Login</button>
<button type="button" class="cancelbtn">Cancel</button>
<p>Not registered yet? <a href="#">Register here</a>.</p>
</form>
</div>
</body>
</html>
希望这个代码能够帮到您!