TutorialsPreview
Build with AIBuildbeginner10 min

Build the card with AI

You will not write every line — you will direct a model to. The skill is knowing enough to catch what it gets wrong.

You will build

The same card — produced by a coding model under your direction, then corrected by your review.

You will learn

What to understand about the box model BEFORE you prompt, how to write the prompt, and the exact things to check in the output.

Prerequisites

A coding assistant (Claude, Codex, Copilot — any). No CSS mastery required; that is the point.

The 20% you must own before you prompt

You cannot review what you do not understand. For a card, the mental model you need fits on a postcard:

  • Every element is a box: content → padding → border → margin, from the inside out.
  • box-sizing: border-box makes width include padding and border — the difference between layouts that hold and layouts that overflow.
  • Padding is space inside the box; margin is space outside it. Faking one with the other is the single most common AI mistake.
Concept · ai/prompting
Catalog

Prompt design

Writing inputs that lead a model to do the work you actually want — the skill that replaces "Google it" in the AI era.

Want the full picture? Open the reference →

The prompt

A good prompt names the constraints a senior would name. Vague in, vague out:

Build a reusable "card" component in plain HTML and CSS — no framework, no build step.
Constraints:
- Set box-sizing: border-box globally so width includes padding and border.
- Card: max-width 320px, 24px internal padding, 16px corner radius.
- One soft elevation shadow. No border.
- Dark surface (#11151c) with legible body text — check the contrast.
- A primary button with its own padding and a hover state.
Output one index.html and one styles.css. Add one short comment per rule explaining the spacing decision.
Paste into Claude, Codex, or any assistant

Review what it writes

This is the senior move. Run the output against a checklist before you trust it:

Review rubric

Now take the model’s output and change one thing — bump the padding, soften the shadow — and watch it respond. Editing what the AI wrote is how you learn faster than it does:

try yourself · css
preview

Tutorial

Want the why first?

The Learn and Deep tabs teach the box model directly. Come back here when you want to build with it.

Concepts covered · 2

More like this

Y
Build·beginner·12 min

Your first Python program

Python reads almost like English. Write a small converter, see its output, and open the project in /code to keep editing.

B
Build·beginner·8 min

Build a program with AI

The vibe-coder path for Go: the idioms you must recognise, the prompt, and the review that catches dropped errors.

Y
Build·beginner·14 min

Your first C++ program

C++ trades a little ceremony for a lot of speed and control. Write a first program, learn the compile-then-run cycle, and open it in /code.

Liked this one?

Pass it on

Discussion

Be the first to ask

Your questions stay private with the team. We can pin answers to share with everyone.

Sign in to ask a question privately on this tutorial.

Sign in

No pinned answers yet for this tutorial.