所需文件如下:
草方块.ico为页签图标(可以替换为自己想要得图标icon)
new_video.mp4为背景视频(可以替换为自己的视频内容)
login.html文件内容
<!DOCTYPE html>
<html lang="en">
<head>
<!-- charset设置页面的编码为UTF-8-->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- title标签设置页面的标签页的名字-->
<title>mc-sharing-proj</title>
<!-- link设置页面的图标,rel属性是必须的,规定当前文档与被链接文档/资源之间的关系。href为图标文件的路径-->
<link rel="shortcut icon" href="../images/草方块.ico">
<link type="text/css" href="../style/login.css" rel="stylesheet">
</head>
<body>
<div class="login-page" id="login-app">
<video id="background_v" autoplay loop muted>
<source id='background' src="../video/new_video.mp4"/>
</video>
<div class="login-box">
<h1>Login</h1>
<form action="">
<div class="inputBox">
<input type = 'text' name="" required="">
<label>Username</label>
</div>
<div class="inputBox">
<input type = 'password' name="" required="">
<label>Password</label>
</div>
<input type="submit" name="" value="Submit">
</form>
</div>
</div>
</body>
</html>
login.css文件内容
@charset "utf-8";
/*CSS Document */
body {
margin: 0px;
padding: 0px;
font-family: sans-serif;
}
.login-box {
position: absolute;
top: 70%;
left: 50%;
transform: translate(-50%, -50%);
width: 400px;
padding: 30px;
background: rgba(255, 255, 255, .5);
box-sizing: border-box;
box-shadow: 0 15px 25px rgba(255, 255, 255, .3);
border-radius: 10px;
}
.login-box h1 {
margin: 0 0 30px;
padding: 0px;
color: rgba(255, 255, 255, .9);
text-align: center;
}
.login-box .inputBox {
position: relative;
}
.login-box .inputBox input {
width: 100%;
padding: 10px 0;
font-size: 22px;
color: rgba(0, 0, 0, .7);
margin-bottom: 30px;
border: none;
border-bottom: 1px solid rgba(0, 0, 0, .8);
outline: none;
background: transparent;
}
.login-box .inputBox label {
position: absolute;
top: 0;
left: 0;
padding: 10px 0;
font-size: 22px;
color: rgba(0, 0, 0, .3);
pointer-events: none;
transition: .5s;
}
.login-box .inputBox input:focus ~ label,
.login-box .inputBox input:valid ~ label {
top: -20px;
left: 0;
color: rgba(0, 0, 0, .7);
font-size: 16px;
}
.login-box input[type="submit"] {
position: relative;
left: 50%;
transform: translateX(-50%);
border: none;
outline: none;
background: rgba(255,255,255,.7);
font-size: 20px;
color: rgba(0,0,0,.7);
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
}
#background_v {
position: fixed;
right: 0px;
bottom: 0px;
min-width: 100%;
min-height: 100%;
height: auto;
width: auto;
/*加滤镜*/
/*filter: blur(15px); //背景模糊设置 */
/*-webkit-filter: grayscale(100%);*/
/*filter:grayscale(100%); //背景灰度设置*/
z-index: -11
}
#background {
min-width: 100%;
min-height: 100%;
height: auto;
width: auto;
}