登陆界面截图
HTML代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./login.css" type="text/css">
<title>登陆界面</title>
</head>
<body>
<div id="login">
<form action="#" method="POST" id="form">
<h2 id="login_title">Login</h2>
<br />
<input type="text" placeholder="请输入用户名" name="username" id="un" autocomplete="off">
<br />
<input type="password" placeholder="请输入密码" name="password" id="pd" autocomplete="off">
<br />
<br />
<input type="submit" name="sub" value="登录" id="sub" autocomplete="off">
<p id="more-link">
<a href="#">返回首页</a>
•
<a href="#">用户注册</a> <!-- 点击后跳转注册页面 -->
</p>
</form>
</div>
</body>
</html>
CSS代码
*{
padding: 0;
margin: 0;
}
body{
background-color: rgb(123, 214, 241);
/* 不想添加背景颜色可以更换为背景图片 */
/* background: url("图片地址"); */
opacity: 1.0;
}
#login{
display: flex;
width: 300px;
height: 400px;
background-color: white;
/* opacity: 0.8; */
text-align: center;
margin:100px auto;
justify-content: center;
}
#form{
float: left;
}
#login_title{
margin-top: 50px;
}
#un{
width: 200px;
height: 30px;
border: none;
border-bottom: solid 1px black;
margin-top: 30px;
}
#un:focus{
outline: none; /* 去除username的input框点击输入时边框 */
}
#pd{
width: 200px;
height: 30px;
border: none;
border-bottom: solid 1px black;
margin-top: 30px;
}
#pd:focus{
/* border: red; 如果加上border颜色则输入时没有任何边框 */
outline: none; /* 去除passwod的input框点击输入时边框 */
}
#sub{
width: 200px;
height: 30px;
margin-top: 30px;
border: black solid 1px;
border-radius:10px
}
#more-link{
color: #467B96;
margin-top: 20px;
}
#more-link a{
background: transparent;
text-decoration: none;
color: #467B96;
}
界面
欢迎一起交流探讨