请通过以上代码 帮我写出login.html代码和s1.css代码
时间: 2024-03-10 18:46:33 浏览: 24
好的,以下是示例代码:
login.html
```
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Login</title>
<link rel="stylesheet" href="s1.css">
</head>
<body>
<div class="login-box">
<h2>Login</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>
```
s1.css
```
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: sans-serif;
}
body {
background: #1e272e;
}
.login-box {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 350px;
height: 500px;
padding: 80px 40px;
background: #fff;
border-radius: 10px;
}
.login-box h2 {
margin: 0 0 30px;
padding: 0;
color: #333;
text-align: center;
}
.login-box .user-box {
position: relative;
}
.login-box .user-box input {
width: 100%;
padding: 10px 0;
font-size: 16px;
color: #333;
margin-bottom: 30px;
border: none;
border-bottom: 1px solid #777;
outline: none;
background: transparent;
}
.login-box .user-box label {
position: absolute;
top: 0;
left: 0;
padding: 10px 0;
font-size: 16px;
color: #777;
pointer-events: none;
transition: .5s;
}
.login-box .user-box input:focus ~ label,
.login-box .user-box input:valid ~ label {
top: -20px;
left: 0;
color: #333;
font-size: 12px;
}
.login-box a {
display: inline-block;
background: #1e272e;
color: #fff;
text-transform: uppercase;
font-size: 16px;
text-align: center;
padding: 14px 40px;
margin-top: 50px;
border-radius: 30px;
overflow: hidden;
position: relative;
}
.login-box a span {
position: absolute;
display: block;
background: #fff;
width: 20px;
height: 20px;
border-radius: 50%;
animation: a 1s linear infinite;
z-index: -1;
}
.login-box a span:nth-child(1) {
left: -25%;
top: -50%;
animation-delay: 0ms;
}
.login-box a span:nth-child(2) {
left: -25%;
top: 150%;
animation-delay: 500ms;
}
.login-box a span:nth-child(3) {
right: -25%;
top: -50%;
animation-delay: 1000ms;
}
.login-box a span:nth-child(4) {
right: -25%;
top: 150%;
animation-delay: 1500ms;
}
.login-box a:hover span {
animation: none;
}
@keyframes a {
0% {
transform: scale(1);
opacity: 1;
}
100% {
transform: scale(5);
opacity: 0;
}
}
```
注意:以上代码仅供参考,您可以根据自己的需求进行修改。同时,如果您需要使用其中的动画效果,还需要在页面中引入jQuery库。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://img-home.csdnimg.cn/images/20210720083646.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)
![](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)