作者:你死了涐陪葬_793 | 来源:互联网 | 2023-09-16 16:54
篇首语:本文由编程笔记#小编为大家整理,主要介绍了一个简单的CSS登录页相关的知识,希望对你有一定的参考价值。
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content=">
<title>loginPagetitle>
<style>
html{
height: 100%;
}
body{
background-image: linear-gradient(to top, #330867 0%, #30cfd0 100%);
margin: 0;
}
h2{
text-align: center;
color: white;
}
.box{
width: 400px;
height: 320px;
background-color: black;
border-radius: 10px;
margin: 0 auto;
margin-top: 10%;
padding: 30px;
opacity: 0.7;
}
.item{
height: 45px;
width: 100%;
color: #03e9f4;
border-bottom: 1px solid #fff;
margin-bottom: 40px;
position: relative;
}
.item input{
width: 100%;
height: 100%;
color: white;
}
.item input:focus+label,.item input:valid+label{
top: 0;
font-size: 12px;
color: white;
}
.item label{
position: absolute;
left: 0;
top: 12px;
transition: all 0.3s linear;
}
.btn{
width: 100px;
height: 40px;
border: 1px solid white;
border-radius: 10px;
color: #03e9f4;
padding: 10px 20px;
margin-left: 150px;
margin-top: 15px;
}
.btn:hover{
background-color: #03e9f4;
color: white;
box-shadow: 0 0 5px 0 #03e9f4,
0 0 25px 0 #03e9f4,
0 0 50px 0 #03e9f4,
0 0 100px 0 #03e9f4;
text-transform: uppercase;
}
input,button{
width: 100%;
height: 100%;
background-color: transparent;
outline: none;
border: none;
padding-top: 20px;
box-sizing: border-box;
}
style>
head>
<body>
<div class="box">
<h2>Loginh2>
<form action="">
<div class="item">
<input type="text" required>
<label>Usernamelabel>
div>
<div class="item">
<input type="password" required>
<label>Passwordlabel>
div>
<button class="btn">submitbutton>
form>
div>
body>
html>