帮我写一个网页登录界面
时间: 2023-08-28 13:24:01 浏览: 43
好的,下面是一个简单的网页登录界面,包含用户名、密码和登录按钮:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<meta charset="UTF-8">
<style>
body {
background-color: #f2f2f2;
}
.container {
margin: 0 auto;
width: 300px;
padding: 20px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 0 5px rgba(0,0,0,0.3);
}
h1 {
text-align: center;
font-size: 24px;
margin: 0 0 20px 0;
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 3px;
margin-bottom: 20px;
box-sizing: border-box;
font-size: 16px;
}
input[type="submit"] {
background-color: #4CAF50;
color: #fff;
font-size: 16px;
padding: 10px;
border: none;
border-radius: 3px;
cursor: pointer;
width: 100%;
}
input[type="submit"]:hover {
background-color: #3e8e41;
}
</style>
</head>
<body>
<div class="container">
<h1>Login</h1>
<form method="post" action="login.php">
<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>
</div>
</body>
</html>
```
这个登录界面使用了简单的HTML和CSS样式,样式包括了背景颜色、容器样式、标题样式、文本框样式、按钮样式等。其中用户名和密码输入框使用了`<input type="text">`和`<input type="password">`,登录按钮使用了`<input type="submit">`。
这个登录界面的提交目标是`login.php`,需要在服务器端编写相应的处理程序来验证用户输入的用户名和密码是否正确。
相关推荐
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)