The code
<form class="lf-form" action="/api/login" method="POST">
<div class="field">
<label for="f-email">Email address *</label>
<input id="f-email" name="email" type="email" placeholder="you@example.com" autocomplete="email" required />
</div>
<div class="field">
<label for="f-password">Password *</label>
<input id="f-password" name="password" type="password" placeholder="Your password" autocomplete="current-password" required />
</div>
<label class="checkbox">
<input type="checkbox" name="remember" value="1" />
<span>Remember me</span>
</label>
<button type="submit">Sign in</button>
</form>
<style>
.lf-form { max-width: 480px; margin: 0 auto; font-family: system-ui, sans-serif; }
.lf-form .field { margin-bottom: 1rem; }
.lf-form label, .lf-form legend { display: block; font-weight: 500; margin-bottom: 0.35rem; font-size: 0.9rem; }
.lf-form input, .lf-form select, .lf-form textarea {
width: 100%; padding: 0.65rem 0.75rem; font-size: 1rem;
border: 1px solid #d1d5db; border-radius: 0.5rem; background: #fff;
font-family: inherit;
}
.lf-form input:focus, .lf-form select:focus, .lf-form textarea:focus {
outline: 2px solid #2563eb; outline-offset: 1px; border-color: #2563eb;
}
.lf-form .checkbox, .lf-form .radio { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.lf-form .checkbox input, .lf-form .radio input { width: auto; }
.lf-form button {
width: 100%; padding: 0.75rem 1rem; font-size: 1rem; font-weight: 600;
color: #fff; background: #2563eb; border: 0; border-radius: 0.5rem; cursor: pointer;
}
.lf-form button:hover { background: #1d4ed8; }
</style>Live preview
Rendered in a sandboxed iframe — exactly what you'll get when you paste the snippet.
Frequently asked questions
Does this login form support password managers?
Yes — inputs use the correct type and autocomplete values (email, current-password) so 1Password, Bitwarden, and the browser's built-in manager pick them up automatically.
How do I add a 'Forgot password' link?
Add an <a href="/forgot-password"> above the submit button. LemForms can host the reset flow as a single-question form if you don't want to build it.
How do I add social login (Google, GitHub)?
Add <button type="button"> elements above the email field that trigger your OAuth flow. For no-code, embed a LemForms form with branching that routes to your auth provider.
Skip the HTML — build this in 30 seconds
LemForms gives you the same form with a real backend: submissions dashboard, email notifications, conditional logic, file uploads, webhooks, and Stripe payments. No code.
Try LemForms freeRelated snippets
- Signup form HTML templateFree signup form HTML template — plain HTML/CSS and Tailwind versions, accessible labels, working validation. Copy, paste, ship.
- Contact form HTML templateAccessible contact form HTML template you can copy in under a minute. Plain HTML/CSS and Tailwind versions, with name, email, subject, and message fields.
- Subscription form HTML templateEmail subscription form HTML template with plan selector, GDPR consent checkbox, and accessible labels. Copy-paste ready.
- Booking form HTML templateFree booking form HTML template with native date + time pickers, party size, and notes field. Plain HTML and Tailwind variants.
- Survey form HTML templateFree survey form HTML template with rating scale, multiple-choice, and open-ended fields. Accessible, mobile-friendly, copy-paste ready.
- Quiz form HTML templateFree quiz form HTML template with multiple-choice questions and a submit handler. Plain HTML and Tailwind versions, ready to copy.