使用html写一个前端登录页面
时间: 2024-06-05 07:06:41 浏览: 11
<!DOCTYPE html>
<html>
<head>
<title>登录页面</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
body {
font-family: Arial, sans-serif;
background-color: #f1f1f1;
}
form {
background-color: #fff;
padding: 20px;
max-width: 400px;
margin: 50px auto;
border-radius: 10px;
box-shadow: 0px 0px 10px rgba(0,0,0,0.2);
}
h1 {
text-align: center;
color: #333;
margin-top: 0px;
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 10px;
color: #666;
}
input[type="text"], input[type="password"] {
padding: 8px;
border-radius: 5px;
border: none;
font-size: 16px;
width: 100%;
margin-bottom: 20px;
}
input[type="submit"] {
background-color: #4CAF50;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #3e8e41;
}
.error-msg {
color: red;
font-size: 14px;
font-weight: bold;
margin-top: 10px;
text-align: center;
}
</style>
</head>
<body>
<form method="post" action="">
<h1>用户登录</h1>
<label>用户名</label>
<input type="text" name="username" required>
<label>密码</label>
<input type="password" name="password" required>
<input type="submit" value="登录">
<div class="error-msg"><?php echo $error; ?></div>
</form>
</body>
</html>
相关推荐
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.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)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)