简单的登录界面html源代码
时间: 2023-07-31 15:03:57 浏览: 40
以下是一个简单的登录界面的 HTML 源代码:
```html
<!DOCTYPE html>
<html>
<head>
<title>登录界面</title>
</head>
<body>
<form>
<label for="username">用户名:</label>
<input type="text" id="username" name="username"><br><br>
<label for="password">密码:</label>
<input type="password" id="password" name="password"><br><br>
<input type="submit" value="登录">
</form>
</body>
</html>
```
该代码包含一个表单,其中包含用户名和密码输入框以及一个提交按钮。用户名和密码输入框都有一个 "id" 和 "name" 属性,用于将输入的值传递到后端处理。在提交表单时,浏览器将发送一个 POST 请求,将表单数据发送到指定的 URL。
相关问题
html简单登录注册界面源代码
HTML简单登录注册界面源代码如下:
```html
<!DOCTYPE html>
<html>
<head>
<title>登录/注册界面</title>
<style>
body {
font-family: Arial, sans-serif;
}
.container {
width: 300px;
margin: 0 auto;
padding: 20px;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
display: block;
margin-bottom: 5px;
}
.form-group input[type="text"],
.form-group input[type="password"] {
width: 100%;
padding: 5px;
}
.form-group .btn {
display: block;
width: 100%;
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
cursor: pointer;
}
</style>
</head>
<body>
<div class="container">
<h2>登录</h2>
<form action="login.php" method="POST">
<div class="form-group">
<label for="username">用户名:</label>
<input type="text" id="username" name="username" required>
</div>
<div class="form-group">
<label for="password">密码:</label>
<input type="password" id="password" name="password" required>
</div>
<button type="submit" class="btn">登录</button>
</form>
<hr>
<h2>注册</h2>
<form action="register.php" method="POST">
<div class="form-group">
<label for="new-username">用户名:</label>
<input type="text" id="new-username" name="new-username" required>
</div>
<div class="form-group">
<label for="new-password">密码:</label>
<input type="password" id="new-password" name="new-password" required>
</div>
<button type="submit" class="btn">注册</button>
</form>
</div>
</body>
</html>
```
这段代码展示了一个简单的登录/注册界面。其中包含两个表单,分别用于登录和注册功能。用户可以输入用户名和密码进行登录,也可以注册新的用户名和密码。登录和注册表单均使用POST方法提交到相应的处理程序(`login.php`和`register.php`)。使用CSS样式对界面进行简单的美化,包括边距、边框、背景等。
可爱登录界面html源代码
以下是一个简单的可爱登录界面的 HTML 源代码:
```html
<!DOCTYPE html>
<html>
<head>
<title>可爱登录界面</title>
<style>
body {
background-color: #F8E0E0;
font-family: Arial, sans-serif;
}
h1 {
color: #FF69B4;
text-align: center;
}
form {
background-color: #FFFFFF;
border-radius: 10px;
padding: 20px;
width: 300px;
margin: 0 auto;
}
label {
display: block;
margin-bottom: 10px;
color: #FF69B4;
}
input[type="text"], input[type="password"] {
padding: 5px;
border-radius: 5px;
border: none;
width: 100%;
margin-bottom: 20px;
}
input[type="submit"] {
background-color: #FF69B4;
color: #FFFFFF;
border-radius: 5px;
border: none;
padding: 10px;
cursor: pointer;
width: 100%;
}
</style>
</head>
<body>
<h1>可爱登录界面</h1>
<form>
<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>
```