登录界面html源代码
时间: 2023-09-03 22:08:26 浏览: 44
以下是一个简单的登录界面的 HTML 源代码示例:
```
<!DOCTYPE html>
<html>
<head>
<title>登录</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: Arial, sans-serif;
background-color: #f2f2f2;
}
h1 {
text-align: center;
margin-top: 50px;
}
form {
background-color: #fff;
border-radius: 10px;
width: 400px;
margin: 0 auto;
padding: 20px;
box-shadow: 0px 0px 10px #ccc;
}
label {
display: block;
margin-bottom: 10px;
font-weight: bold;
}
input[type="text"], input[type="password"] {
padding: 10px;
border-radius: 5px;
border: none;
box-shadow: 0px 0px 5px #ccc;
width: 100%;
margin-bottom: 20px;
}
input[type="submit"] {
background-color: #4CAF50;
color: #fff;
padding: 10px;
border: none;
border-radius: 5px;
cursor: pointer;
font-weight: bold;
width: 100%;
}
input[type="submit"]:hover {
background-color: #3e8e41;
}
</style>
</head>
<body>
<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>
</body>
</html>
```
在这个示例中,我们使用了一个简单的 HTML 表单,其中包括一个用户名输入框、一个密码输入框和一个登录按钮。这个表单使用了一些 CSS 样式来美化它的外观。当用户点击登录按钮时,表单将会提交到服务器端进行处理。