写一个炫酷的前端登录页面
时间: 2023-11-02 22:11:09 浏览: 20
好的,以下是一个简单的炫酷前端登录页面的示例:
HTML代码:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cool Login Page</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="login-container">
<h1>Login</h1>
<form>
<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email" placeholder="Enter your email" />
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" id="password" placeholder="Enter your password" />
</div>
<button type="submit">Login</button>
</form>
<div class="social-login">
<span>Or login with</span>
<a href="#" class="social-link facebook">
<i class="fab fa-facebook"></i>
</a>
<a href="#" class="social-link twitter">
<i class="fab fa-twitter"></i>
</a>
<a href="#" class="social-link google">
<i class="fab fa-google"></i>
</a>
</div>
</div>
</body>
</html>
```
CSS代码:
```css
@import url("https://use.fontawesome.com/releases/v5.15.2/css/all.css");
body {
background-color: #f5f5f5;
font-family: "Open Sans", sans-serif;
}
.login-container {
background-color: #fff;
border-radius: 5px;
box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.2);
margin: 50px auto;
max-width: 500px;
padding: 40px;
}
h1 {
text-align: center;
}
form {
margin-top: 30px;
}
.form-group {
margin-bottom: 20px;
}
label {
display: block;
font-size: 14px;
font-weight: 600;
margin-bottom: 5px;
}
input {
border: none;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
font-size: 16px;
padding: 10px;
width: 100%;
}
button[type="submit"] {
background-color: #008000;
border: none;
border-radius: 5px;
color: #fff;
cursor: pointer;
font-size: 16px;
font-weight: 600;
margin-top: 20px;
padding: 10px;
transition: background-color 0.2s ease-in-out;
width: 100%;
}
button[type="submit"]:hover {
background-color: #006400;
}
.social-login {
margin-top: 20px;
text-align: center;
}
.social-login span {
display: block;
font-size: 14px;
margin-bottom: 10px;
}
.social-link {
background-color: #fff;
border: 1px solid #ddd;
border-radius: 50%;
color: #