写一个登录页面html
时间: 2023-12-18 20:06:04 浏览: 29
以下是一个简单的登录页面的HTML代码:
```
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
</head>
<body>
<h1>Login</h1>
<form>
<label for="username">Username:</label>
<input type="text" id="username" name="username" required><br><br>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required><br><br>
<input type="submit" value="Login">
</form>
</body>
</html>
```
此代码包括一个表单,其中包含用户名和密码输入框以及一个登录按钮。当用户点击“登录”按钮时,表单将提交到服务器,然后进行验证和处理。
相关问题
写一个登录界面html
以下是一个简单的登录界面HTML代码:
```
<!DOCTYPE html>
<html>
<head>
<title>Login Form</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
background-color: #F7F7F7;
font-family: Arial, sans-serif;
}
h2 {
color: #333;
text-align: center;
margin-top: 50px;
}
form {
background-color: #FFF;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
max-width: 400px;
margin: 50px auto;
}
label {
display: block;
margin-bottom: 8px;
color: #333;
}
input[type="text"], input[type="password"] {
padding: 10px;
border-radius: 5px;
border: none;
width: 100%;
margin-bottom: 20px;
box-sizing: border-box;
}
input[type="submit"] {
background-color: #4CAF50;
color: #FFF;
padding: 10px;
border-radius: 5px;
border: none;
width: 100%;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #3E8E41;
}
</style>
</head>
<body>
<h2>Login Form</h2>
<form action="#" method="post">
<label for="username">Username</label>
<input type="text" id="username" name="username" required>
<label for="password">Password</label>
<input type="password" id="password" name="password" required>
<input type="submit" value="Login">
</form>
</body>
</html>
```
该代码包含一个标题,一个表单和两个输入框(一个用于输入用户名,另一个用于输入密码),以及一个提交按钮。用户在输入框中输入用户名和密码,然后点击提交按钮,该表单将发送到服务器以进行处理。
写一个登陆页面html
<!DOCTYPE html>
<html>
<head>
<title>登陆页面</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
font-size: 16px;
line-height: 1.6;
padding: 0;
margin: 0;
}
.container {
max-width: 500px;
margin: 0 auto;
padding: 20px;
box-sizing: border-box;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0,0,0,0.2);
}
h1 {
font-size: 28px;
font-weight: 600;
text-align: center;
color: #333;
margin: 0 0 20px;
}
form {
display: flex;
flex-direction: column;
align-items: center;
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 10px;
margin: 10px 0;
border: none;
border-radius: 5px;
box-shadow: 0 0 5px rgba(0,0,0,0.2);
}
input[type="submit"] {
width: 100%;
padding: 10px;
margin: 10px 0;
border: none;
border-radius: 5px;
background-color: #333;
color: #fff;
font-size: 16px;
font-weight: 600;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #555;
}
</style>
</head>
<body>
<div class="container">
<h1>登陆</h1>
<form action="#" method="post">
<label for="username">用户名</label>
<input type="text" id="username" name="username" required>
<label for="password">密码</label>
<input type="password" id="password" name="password" required>
<input type="submit" value="登陆">
</form>
</div>
</body>
</html>
相关推荐
![htm](https://img-home.csdnimg.cn/images/20210720083646.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)