Resources:
Font Awesome CDN
Font Awesome site
Google Fonts
Source Code:
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link
href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
rel="stylesheet"
integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN"
crossorigin="anonymous"
/>
<script
src="https://kit.fontawesome.com/75e53ee709.js"
crossorigin="anonymous"
></script>
<link
href="https://fonts.googleapis.com/css?family=Poppins&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="style.css" />
<title>Account login Form</title>
</head>
<body>
<div class="overlay">
<div class="form_container">
<h2>ACCOUNT LOGIN</h2>
<form action="">
<div class="username">
<i class="far fa-user"></i
><input type="text" placeholder="Username" />
</div>
<div class="password">
<i class="fas fa-lock"></i
><input type="password" placeholder="Password" />
</div>
<div class="submit">
<input type="submit" value="LOGIN" />
</div>
</form>
</div>
</div>
</body>
</html>
CSS:
* {
margin: 0;
padding: 0;
font-size: 16px;
}
body {
font-family: "Poppins", sans-serif;
background: url(/img/48397638_590904144676367_7488300318371872768_n.jpg)
no-repeat center center/cover;
color: white;
height: 100vh;
width: 100%;
}
.overlay {
background-color: rgba(27, 27, 27, 0.7);
position: absolute;
height: 100vh;
width: 100%;
}
.form_container {
position: relative;
width: 300px;
height: 300px;
top: 35vh;
margin: auto;
z-index: 3;
}
.form_container h2 {
text-align: center;
font-size: 1.5rem;
font-weight: 100;
margin-bottom: 0.5rem;
}
form {
background-color: white;
width: 280px;
height: 180px;
border-radius: 10px;
}
form i {
color: lightgray;
padding: 0 2rem;
}
form {
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
justify-items: center;
align-self: center;
align-content: center;
}
.username,
.password {
border-bottom: 1px solid lightgray;
width: 100%;
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}
form input {
outline: none;
border: none;
}
form input[type="text"],
input[type="password"] {
font-family: "Poppins", sans-serif;
font-weight: 500;
}
form input[type="submit"] {
font-family: "Poppins", sans-serif;
background-color: #d41771;
border-radius: 20px;
height: 35px;
width: 130px;
color: #ffffff;
cursor: pointer;
font-weight: 500;
}
Like this:
Like Loading...