پیشنمایش زنده
کد HTML
<div class="form-container">
<p class="title">Login</p>
<form class="form">
<div class="input-group">
<label for="username">Username</label>
<input type="text" name="username" id="username" placeholder="" />
</div>
<div class="input-group">
<label for="password">Password</label>
<input type="password" name="password" id="password" placeholder="" />
<div class="forgot">
<a rel="noopener noreferrer" href="#">Forgot Password ?</a>
</div>
</div>
<button class="sign">Sign in</button>
</form>
<div class="social-message">
<div class="line"></div>
<p class="message">Login with social accounts</p>
<div class="line"></div>
</div>
<div class="social-icons">
<button aria-label="Log in with Google" class="icon">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 32 32"
class="w-5 h-5 fill-current"
></svg>
</button>
<button aria-label="Log in with Twitter" class="icon">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 32 32"
class="w-5 h-5 fill-current"
></svg>
</button>
<button aria-label="Log in with GitHub" class="icon">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 32 32"
class="w-5 h-5 fill-current"
></svg>
</button>
</div>
<p class="signup">
Don't have an account?
<a rel="noopener noreferrer" href="#" class="">Sign up</a>
</p>
</div>
کد CSS
.form-container {
width: 320px;
border-radius: 0.75rem;
background-color: #f7f7f7; /* light gray background */
padding: 2rem;
color: #333; /* dark gray text */
}
.title {
text-align: center;
font-size: 1.5rem;
line-height: 2rem;
font-weight: 700;
color: #00698f; /* blue title */
}
.form {
margin-top: 1.5rem;
}
.input-group {
margin-top: 0.25rem;
font-size: 0.875rem;
line-height: 1.25rem;
}
.input-group label {
display: block;
color: #666; /* dark gray label */
margin-bottom: 4px;
}
.input-group input {
width: 100%;
border-radius: 0.375rem;
border: 1px solid #ccc; /* light gray border */
outline: 0;
background-color: #f7f7f7; /* light gray background */
padding: 0.75rem 1rem;
color: #333; /* dark gray text */
}
.input-group input:focus {
border-color: #00698f; /* blue border on focus */
}
.forgot {
display: flex;
justify-content: flex-end;
font-size: 0.75rem;
line-height: 1rem;
color: #666; /* dark gray forgot password */
margin: 8px 0 14px 0;
}
.forgot a,
.signup a {
color: #333; /* dark gray link */
text-decoration: none;
font-size: 14px;
}
.forgot a:hover,
.signup a:hover {
text-decoration: underline #00698f; /* blue underline on hover */
}
.sign {
display: block;
width: 100%;
background-color: #00698f; /* blue button */
padding: 0.75rem;
text-align: center;
color: #fff; /* white text */
border: none;
border-radius: 0.375rem;
font-weight: 600;
}
.social-message {
display: flex;
align-items: center;
padding-top: 1rem;
}
.line {
height: 1px;
flex: 1 1 0%;
background-color: #ccc; /* light gray line */
}
.social-message .message {
padding-left: 0.75rem;
padding-right: 0.75rem;
font-size: 0.875rem;
line-height: 1.25rem;
color: #666; /* dark gray social message */
}
.social-icons {
display: flex;
justify-content: center;
}
.social-icons .icon {
border-radius: 0.125rem;
padding: 0.75rem;
border: none;
background-color: transparent;
margin-left: 8px;
}
.social-icons .icon svg {
height: 1.25rem;
width: 1.25rem;
fill: #fff; /* white icon */
}
.signup {
text-align: center;
font-size: 0.75rem;
line-height: 1rem;
color: #666; /* dark gray signup */
}