Adoption Steps and the Form
Two sections are left: How to Adopt (id="adopt"), with three steps in an ordered list ol, and Contact (id="contact"), with the address and a form.
- The same classes again. Both sections need the same width and padding as Our Cats. You can copy its classes, or write them just once as your own class, for example
.sectionin@layer componentswith@apply, as in the previous lesson. - Steps side by side. On phones, the steps are one below another, and from
md:up next to each other: with a grid,grid gap-6 md:grid-cols-3, or with flexbox,flex flex-col gap-6 md:flex-row. - Round numbers. Preflight has removed the numbers of the list, so each step has its number in a
span. A circle is a square with fully rounded corners (size-10 rounded-full), andflex items-center justify-centerputs the number in its middle. - Form fields. Preflight has also removed the borders and the padding of the fields, so you can hardly see them. Give them a border, padding and rounded corners. Each label is in a
divwith its field:flex flex-col gap-1on thedivputs the label above the field. - Focus. Visitors who move through the form with the Tab key need to see which field they're in. Give the fields and the button a clear focus style, for example
focus:outline-2 focus:outline-brand-500. Never just remove the outline (outline-hidden) without replacing it with something else.
On wide screens, the address and the form can be side by side: the div that holds them can be a grid, too.
Instructions
Give the sections #adopt and #contact the same width, centering and padding as #cats, and their headings the same look.
Lay out the three steps (the li elements) one below another with gaps on phones, and side by side from md: up, for example with grid gap-6 md:grid-cols-3 on the ol. Give each step a box of its own, too, for example rounded-2xl bg-white p-6 shadow-md.
Turn the numbers of the steps into round badges with a background color and the number in the middle, for example flex size-10 items-center justify-center rounded-full bg-brand-500 font-bold text-white.
Style the form fields (both input elements and the textarea): as wide as the form, with a border, padding and a focus style, for example w-full rounded-lg border border-stone-300 px-3 py-2 focus:outline-2 focus:outline-brand-500.
Style the Send button: a background color, padding, the pointer cursor, a hover style and a focus style, for example cursor-pointer rounded-full bg-brand-500 px-6 py-3 font-semibold text-white hover:bg-brand-600 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand-500.
Start programming for free
3/5