php学生选课系统登录页面css,分享HTML和CSS实现的炫酷登录页面代码
时间: 2023-09-02 15:09:49 浏览: 59
好的,以下是一个简单的学生选课系统登录页面的HTML和CSS实现的炫酷登录页面代码:
HTML代码:
```html
<!DOCTYPE html>
<html>
<head>
<title>学生选课系统登录</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="login-box">
<h2>学生选课系统登录</h2>
<form>
<div class="user-box">
<input type="text" name="" required="">
<label>用户名</label>
</div>
<div class="user-box">
<input type="password" name="" required="">
<label>密码</label>
</div>
<a href="#">
<span></span>
<span></span>
<span></span>
<span></span>
提交
</a>
</form>
</div>
</body>
</html>
```
CSS代码:
```css
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: sans-serif;
}
body {
background: #f2f2f2;
}
.login-box {
width: 280px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: #191919;
padding: 40px;
border-radius: 10px;
box-shadow: 0 0 20px 0 rgba(0,0,0,0.2);
}
.login-box h2 {
color: #fff;
text-align: center;
margin-bottom: 30px;
text-transform: uppercase;
font-weight: 400;
}
.login-box .user-box {
position: relative;
}
.login-box .user-box input {
width: 100%;
padding: 10px 0;
font-size: 16px;
color: #fff;
margin-bottom: 30px;
border: none;
border-bottom: 1px solid #fff;
outline: none;
background: transparent;
}
.login-box .user-box label {
position: absolute;
top: 0;
left: 0;
padding: 10px 0;
font-size: 16px;
color: #fff;
pointer-events: none;
transition: 0.5s;
}
.login-box .user-box input:focus ~ label,
.login-box .user-box input:valid ~ label {
top: -20px;
left: 0;
color: #03a9f4;
font-size: 12px;
}
.login-box a {
display: inline-block;
background: #03a9f4;
color: #fff;
padding: 10px 20px;
border-radius: 5px;
text-decoration: none;
margin-top: 30px;
transition: 0.5s;
}
.login-box a:hover {
background: #fff;
color: #03a9f4;
}
```
这个登录页面使用了HTML的表单元素和CSS的伪类选择器,实现了输入框动态效果和按钮的 hover 效果。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.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)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)