写一个登录界面
时间: 2023-07-07 13:15:48 浏览: 35
以下是一个简单的登录界面示例,使用了HTML和CSS:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login Page</title>
<style type="text/css">
body {
background-color: #F0F0F0;
font-family: Arial, sans-serif;
font-size: 14px;
}
form {
background-color: #FFFFFF;
border: 1px solid #CCCCCC;
border-radius: 5px;
box-shadow: 0px 0px 5px #CCCCCC;
margin: 50px auto;
padding: 20px;
width: 400px;
}
label {
display: block;
margin-bottom: 10px;
}
input[type="text"], input[type="password"] {
border: 1px solid #CCCCCC;
border-radius: 3px;
font-size: 14px;
padding: 5px;
width: 100%;
}
input[type="submit"] {
background-color: #4CAF50;
border: none;
border-radius: 3px;
color: #FFFFFF;
cursor: pointer;
font-size: 14px;
margin-top: 10px;
padding: 10px;
width: 100%;
}
input[type="submit"]:hover {
background-color: #3E8E41;
}
</style>
</head>
<body>
<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>
```
这段代码会生成一个带有用户名和密码输入框以及登录按钮的表单。当用户点击登录按钮时,表单会被提交到服务器进行验证。注意,上述代码只包含前端部分,需要后端代码来实现验证和处理登录请求。
相关推荐
![](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)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)