<html> HTML
<form class="form" onsubmit="event.preventDefault(); alert('Form submitted!');">
<label>
Email
<input type="email" required placeholder="you@example.com">
</label>
<small class="hint">We’ll never share your email.</small>
<button>Submit</button>
</form># CSS
/* TODOs:
1) Add a visible focus style using :focus-visible (with :focus fallback). Use outline, not only box-shadow.
2) Style :invalid inputs with a subtle border color change.
3) Make ::placeholder lighter;
highlight the label group with :focus-within.
*/
/* Plain starter (intentionally minimal so it doesn't look like the solution) */
body {
font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
margin: 2rem;
line-height: 1.6;
background: #fafafa;
color: #111;
}
.form {
border: 1px solid #e5e7eb;
/* light gray */
padding: 12px;
max-width: 420px;
background: #fff;
}
label {
display: block;
margin-bottom: 8px;
}
input {
display: block;
width: 100%;
margin-top: 4px;
padding: 8px 10px;
border: 1px solid #cfcfcf;
border-radius: 4px;
/* subtle */
background: #fff;
color: inherit;
}
button {
margin-top: 10px;
padding: 8px 12px;
border: 1px solid #d1d5db;
border-radius: 4px;
background: #f9fafb;
color: #111;
}
.hint {
display: block;
margin-top: 6px;
color: #6b7280;
/* muted */
}Live preview updates as you type
Building preview…