freecoding.school100% FREE · NO SIGNUP
Neon DistrictISSUE #28 of 50

forms · styling inputs · select · textarea

PrismaVSJank the Janitor
Prisma saysForm controls are stylable with CSS — borders, padding, focus states, and validation pseudo-classes.

Inputs, selects, and textareas accept normal CSS for padding, border, radius, and background. Style focus (:focus/:focus-visible) for clarity, and use validation pseudo-classes :valid, :invalid, :required for live feedback. Some control internals stay browser-controlled, but the basics are yours.

Power-ups you unlock

Jank the Janitor attacks — common mistakes

Boss battleStyle an input with a focus ring and a red border when :invalid.

Example code

<!doctype html><html><head><meta charset="utf-8">
<style>input{padding:8px 10px;background:#0c081a;color:#e6e0ff;border:1px solid #2a1d4a;border-radius:4px}input:focus{outline:2px solid #b388ff}input:invalid{border-color:#ff7a8a}</style></head><body style="background:#06040d;padding:20px"><input type="email" required placeholder="email"></body></html>
▶ Open the interactive comic issue
‹ Attribute Selectors · = · ~= · |= · ^= · $= · *=Forms · Accent-Color · Color-Scheme ›