HTML,用户登录界面
时间: 2023-06-16 16:03:10 浏览: 52
以下是一个简单的 HTML 用户登录界面的示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>User Login</title>
</head>
<body>
<h1>User Login</h1>
<form action="login.php" method="post">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required><br><br>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required><br><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
```
该 HTML 文件包含一个标题和一个表单,其中包含两个文本输入框和一个提交按钮。用户需要在“用户名”和“密码”文本框中输入他们的凭据,并单击“提交”按钮以提交表单。当表单被提交时,它将被发送到“login.php”页面进行处理。
相关问题
html制作用户登陆界面
好的,以下是一个基本的 HTML 用户登录界面的代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>用户登录</title>
</head>
<body>
<h1>用户登录</h1>
<form action="#" method="post">
<label for="username">用户名:</label>
<input type="text" id="username" name="username" required><br><br>
<label for="password">密码:</label>
<input type="password" id="password" name="password" required><br><br>
<input type="submit" value="登录">
</form>
</body>
</html>
```
在这个示例中,我们使用了HTML表单元素来创建一个用户登录界面。该表单包含两个输入字段:用户名和密码,以及一个提交按钮。使用者输入用户名和密码后,点击提交按钮会把输入的数据发送到服务器。
请注意,这是一个非常基本的示例,实际的用户登录界面可能需要更多的功能和样式。
html登陆界面居中
以下是一个HTML登陆界面居中的例子:
```html
<!DOCTYPE html>
<html>
<head>
<title>用户登陆</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
form {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 0 0 5px #ccc;
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 10px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: 5px;
box-sizing: border-box;
}
input[type="submit"] {
width: 100%;
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
</style>
</head>
<body>
<form>
<h2 style="text-align: center;">用户登陆</h2>
<label for="username">用户名:</label>
<input type="text" id="username" name="username" value="guest">
<label for="password">口令:</label>
<input type="password" id="password" name="password" value="guest">
<input type="submit" value="登陆">
</form>
</body>
</html>
```