写一个登陆的前端页面,包括用户名,密码,记住我和登录按钮
时间: 2023-05-21 18:07:06 浏览: 65
以下是一个简单的登陆前端页面的代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
form {
display: flex;
flex-direction: column;
align-items: center;
font-size: 1.2rem;
margin: 50px auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 6px;
box-shadow: 0 2px 5px #ccc;
max-width: 400px;
min-width: 300px;
}
label {
margin-top: 10px;
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
}
input[type="text"], input[type="password"] {
padding: 6px 10px;
border: 1px solid #ccc;
border-radius: 4px;
width: 200px;
}
input[type="checkbox"] {
margin-right: 5px;
}
input[type="submit"] {
margin-top: 10px;
background-color: #4CAF50;
border: none;
color: white;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 1.2rem;
border-radius: 6px;
cursor: pointer;
width: 150px;
transition: background-color 0.3s ease;
}
input[type="submit"]:hover {
background-color: #3E8E41;
}
</style>
</head>
<body>
<form action="#" method="post">
<label>
<span>Username: </span>
<input type="text" name="username" placeholder="Enter your username">
</label>
<label>
<span>Password: </span>
<input type="password" name="password" placeholder="Enter your password">
</label>
<label>
<input type="checkbox" name="remember" value="1">
<span>Remember me</span>
</label>
<input type="submit" name="submit" value="Login">
</form>
</body>
</html>
```
该页面由一个带有用户名和密码字段、记住我和登录按钮的表单组成。用户输入用户名和密码并点击登录按钮后,表单将被提交到服务器进行验证。在这个简单的示例中,表单的 action 属性被设置为 "#",表单数据将不会被提交到任何位置,只是提交到同一页面。@SpringBootTest