用html写一个用户登录界面,界面包含用户名,密码和验证码
时间: 2023-12-03 22:42:18 浏览: 79
下面是一个简单的用户登录界面的HTML代码,包含用户名、密码和验证码输入框及提交按钮。
```
<!DOCTYPE html>
<html>
<head>
<title>User Login</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
form {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 50px;
}
input {
margin: 10px;
padding: 10px;
border-radius: 5px;
border: none;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
}
#submit-btn {
background-color: #4CAF50;
color: white;
padding: 10px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
}
#submit-btn:hover {
background-color: #3e8e41;
}
</style>
</head>
<body>
<form>
<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>
<label for="captcha">Captcha:</label>
<input type="text" id="captcha" name="captcha" required>
<img src="captcha.jpg" alt="captcha">
<button type="button">Refresh</button>
<input type="submit" id="submit-btn" value="Submit">
</form>
</body>
</html>
```
在这个示例中,我们使用了HTML5的表单元素,并添加了一些CSS样式来美化输入框和提交按钮。同时,为了实现验证码功能,我们在表单中添加了一个图片元素和一个刷新按钮,用于生成新的验证码。需要注意的是,这里的验证码图片和验证逻辑需要在后台程序中实现。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.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)