登录界面html源代码 科技感
时间: 2023-08-02 18:40:24 浏览: 51
好的,以下是一个具有科技感的登录界面HTML源代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<title>Techno Login</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
background-color: #1D1F27;
font-family: 'Lato', sans-serif;
color: #fff;
}
h1 {
font-size: 36px;
text-align: center;
margin-top: 50px;
}
.container {
background-color: #fff;
border-radius: 5px;
padding: 40px;
margin: 50px auto;
width: 400px;
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
}
input[type=text], input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: none;
border-bottom: 1px solid #ccc;
background-color: transparent;
color: #fff;
font-size: 16px;
}
input[type=text]:focus, input[type=password]:focus {
border-bottom: 2px solid #1ABC9C;
color: #1ABC9C;
}
button {
background-color: #1ABC9C;
color: #fff;
padding: 14px 20px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
width: 100%;
font-size: 18px;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #148F77;
}
.cancelbtn {
width: auto;
padding: 10px 18px;
background-color: #E74C3C;
transition: background-color 0.3s ease;
}
.cancelbtn:hover {
background-color: #C0392B;
}
.imgcontainer {
text-align: center;
margin: 24px 0 12px 0;
position: relative;
}
img.avatar {
width: 80px;
height: 80px;
border-radius: 50%;
position: absolute;
top: -40px;
left: calc(50% - 40px);
}
.container > p {
text-align: center;
font-size: 18px;
margin-top: 30px;
}
span.psw {
float: right;
padding-top: 16px;
}
@media screen and (max-width: 400px) {
span.psw {
display: block;
float: none;
}
.cancelbtn {
width: 100%;
}
input[type=text], input[type=password] {
font-size: 14px;
}
h1 {
font-size: 30px;
}
.container {
width: 90%;
}
img.avatar {
width: 60px;
height: 60px;
top: -30px;
left: calc(50% - 30px);
}
}
</style>
</head>
<body>
<form action="/action_page.php">
<h1>Techno Login</h1>
<div class="container">
<div class="imgcontainer">
<img src="avatar.png" alt="Avatar" class="avatar">
</div>
<label for="uname"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="uname" required>
<label for="psw"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
<button type="submit">Login</button>
<label>
<input type="checkbox" checked="checked" name="remember"> Remember me
</label>
</div>
<div class="container">
<button type="button" class="cancelbtn">Cancel</button>
<span class="psw">Forgot <a href="#">password?</a></span>
</div>
</form>
</body>
</html>
```
该登录界面使用了深色背景、白色边框和明亮的文本,以及一个带有半透明背景的登录表单。登录表单包含了用户名和密码输入框、记住密码复选框、登录和取消按钮,并使用了过渡动画效果。登录表单的顶部有一个圆形头像。