一个简单的登陆界面代码
时间: 2024-05-14 21:19:09 浏览: 14
可以参考以下示例代码:
```
<html>
<head>
<title>Login Page</title>
</head>
<body>
<h2>Login Form</h2>
<form action="login.php" method="post">
<label>Username:</label><br>
<input type="text" name="username" required><br>
<label>Password:</label><br>
<input type="password" name="password" required><br>
<input type="submit" value="Login">
</form>
</body>
</html>
```
在上面的代码中,我们创建了一个简单的 HTML 表单,用于输入用户名和密码。当用户点击登录按钮时,表单将被提交到名为 "login.php" 的 PHP 脚本中进行验证。在 PHP 脚本中,我们可以从表单中获取用户名和密码,并将其与数据库中存储的凭据进行比较,以判断用户是否有权访问受保护的页面。
相关问题
制作一个简单的html登陆界面代码
以下是一个简单的 HTML 登录界面代码:
```
<!DOCTYPE html>
<html>
<head>
<title>登录</title>
</head>
<body>
<h1>登录</h1>
<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>
```
完成一个简单的登陆界面
好的,我可以给你提供一个简单的登陆界面的HTML和CSS代码,供你参考。
HTML代码:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login Form</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="login-box">
<h2>Login Form</h2>
<form>
<div class="user-box">
<input type="text" name="" required="">
<label>Username</label>
</div>
<div class="user-box">
<input type="password" name="" required="">
<label>Password</label>
</div>
<a href="#">
<span></span>
<span></span>
<span></span>
<span></span>
Submit
</a>
</form>
</div>
</body>
</html>
```
CSS代码:
```css
body {
margin: 0;
padding: 0;
background: #333;
font-family: sans-serif;
}
.login-box {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 350px;
height: 420px;
padding: 80px 40px;
box-sizing: border-box;
background: rgba(0, 0, 0, 0.5);
}
h2 {
margin: 0 0 30px;
padding: 0;
color: #fff;
text-align: center;
}
.user-box {
position: relative;
}
.user-box input {
width: 100%;
padding: 10px 0;
font-size: 16px;
color: #fff;
margin-bottom: 30px;
border: none;
border-bottom: 1px solid #fff;
outline: none;
background: transparent;
}
.user-box label {
position: absolute;
top: 0;
left: 0;
padding: 10px 0;
font-size: 16px;
color: #fff;
pointer-events: none;
transition: 0.5s;
}
.user-box input:focus ~ label, .user-box input:valid ~ label {
top: -20px;
left: 0;
color: #03a9f4;
font-size: 12px;
}
a {
display: inline-block;
background: #03a9f4;
color: #fff;
text-transform: uppercase;
padding: 12px 30px;
margin-top: 40px;
font-size: 16px;
text-decoration: none;
letter-spacing: 2px;
border-radius: 25px;
transition: 0.5s;
}
a:hover {
background: #fff;
color: #03a9f4;
}
```
这个登陆界面包含一个登录框,包括用户名和密码输入框和一个提交按钮。你可以通过CSS样式来自定义你的登陆界面的外观和布局。
相关推荐
![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)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)