Menu
CoddyTech

Recap: Form Layouts

Part of the Responsive UI Patterns section of Coddy's Tailwind CSS journey. Lesson 20 of 55.

challenge icon

Challenge

Hard

Build a contact form capped at 432px. Use one column below 768px and two equal columns above it, with 32px gaps on both axes. The subscription option spans the whole form. Its native checkbox caption is normal-weight unchecked and bold checked. The required email has a solid 4px outline while invalid and zero outline width while valid. Preserve labels and native constraints.

Preserve the supplied content, semantic elements and IDs. Edit the requested utility classes. Press Run preview after edits, then Check/Run code to grade the result. Supplied JavaScript is read-only.

Try it yourself

<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Interface workshop</title><link rel="stylesheet" href="./styles.css"></head><body>
<form id="form" class="w-full max-w-[432px] grid grid-cols-1"><div><label for="name">Name</label><input id="name" class="w-full"></div><div><label for="email">Email</label><input id="email" type="email" required class="w-full outline-solid outline-0"></div><label id="option" class=""><input id="subscribe" type="checkbox" class="peer"><span id="caption" class="font-normal">Monthly news</span></label></form>
</body></html>

All lessons in Responsive UI Patterns