This login card previews the entered credential context before submission to reduce errors and increase confidence.
HTML
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Sign in</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<main class="auth-container">
<form class="login-card" action="/login" method="post">
<button type="button" class="provider-button">
<img
src="https://www.svgrepo.com/show/475656/google-color.svg"
alt="Google"
class="provider-icon"
/>
<span>Continue with Google</span>
</button>
<div class="divider">
<span>or</span>
</div>
<label class="field">
<span class="label">Email address</span>
<input
type="email"
name="email"
placeholder="you@example.com"
required
autocomplete="email"
/>
</label>
<button type="submit" class="primary-button">
Next
</button>
</form>
</main>
</body>CSS
::before,
::after {
box-sizing: border-box;
}
html,
body {
margin: 0;
font-family: system-ui, -apple-system, "Segoe UI",
Roboto, Arial, sans-serif;
background: #f4f6f8;
color: #111827;
}
.auth-container {
min-height: 100vh;
display: grid;
place-items: center;
padding: 16px;
}
.login-card {
width: 100%;
max-width: 200px;
background: #ffffff;
border-radius: 18px;
padding: 0.9rem;
display: grid;
gap: 0.6rem;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}
.provider-button {
display: flex;
align-items: center;
justify-content: center;
gap: 0.45rem;
padding: 0.55rem;
border-radius: 999px;
border: 1px solid #e5e7eb;
background: #ffffff;
font-size: 12px;
font-weight: 600;
cursor: pointer;
transition: background 120ms ease, box-shadow 120ms ease;
}
.provider-button:hover {
background: #f9fafb;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.provider-icon {
width: 18px;
height: 18px;
object-fit: contain;
}
.divider {
display: grid;
grid-template-columns: 1fr auto 1fr;
align-items: center;
gap: 0.4rem;
font-size: 10px;
color: #9ca3af;
}
.divider::before,
.divider::after {
content: "";
height: 1px;
background: #e5e7eb;
}
.field {
display: grid;
gap: 0.25rem;
}
.label {
font-size: 10px;
color: #6b7280;
}
input {
padding: 0.45rem 0.5rem;
border-radius: 10px;
border: 1px solid #d1d5db;
font-size: 12px;
background: #ffffff;
}
input:focus {
outline: none;
border-color: #2563eb;
box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.primary-button {
margin-top: 0.2rem;
padding: 0.5rem;
border-radius: 999px;
border: none;
background: #2563eb;
color: #ffffff;
font-size: 12px;
font-weight: 600;
cursor: pointer;
transition: background 120ms ease, box-shadow 120ms ease;
}
.primary-button:hover {
background: #1d4ed8;
box-shadow: 0 2px 6px rgba(29, 78, 216, 0.35);
}
@media (max-width: 200px) {
.login-card {
padding: 0.75rem;
}
.provider-button,
.primary-button,
input {
font-size: 11px;
}
}Notes
- Reduces incorrect account submission
- Email-first authentication friendly
- Compact and modal-safe
Preview styles shown. Production customization recommended.
Browse More UI Components
Explore hundreds of reusable HTML & CSS UI components built for modern web projects.
Discover buttons, cards, loaders, animations, layouts, and more all with live previews and clean, copy-paste code.
