CODE BUILDERS Lesson 3 of 6 ← All courses
Station 3 · Paint Shop

Style It with CSS

Your site has bones. Now it needs clothes! Today you'll use CSS to choose colors, fonts and spacing, and make your site easy to read.

About 40 minutes. You can stop and come back. Your answers are saved in this browser.

Part 1 · Warm-up

What do you remember?

Last time you learned HTML building blocks. Quick check!

Part 2 · Learn it

CSS rules

CSS is written as rules. Each rule says which part of the page to style, and how to style it.

h1 {
  color: darkorange;
  font-size: 40px;
}

Properties you'll use most

PropertyWhat it changesExample
colorText colorcolor: navy;
background-colorBackground colorbackground-color: lightyellow;
font-familyThe fontfont-family: Arial;
font-sizeText sizefont-size: 18px;
paddingSpace inside a boxpadding: 16px;
marginSpace outside a boxmargin: 20px;
borderA line around a boxborder: 2px solid navy;
border-radiusRounded cornersborder-radius: 12px;

Classes: style just some things

A rule for h1 styles every h1. To style only certain boxes, give them a class. In CSS, a class name starts with a dot.

In CSS
.card {
  background-color: white;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid navy;
}
In HTML
<section class="card">
  <h2>My favorite tricks</h2>
  ...
</section>

Your style.css file

On your real site, CSS lives in its own file called style.css, in the same folder. One line in the <head> of each page connects it:

<head>
  <title>Skate Zone</title>
  <link rel="stylesheet" href="style.css">
</head>

In the playground today, the CSS goes inside a <style> tag instead, so everything fits in one box. It works the same way.

Watch styles work

EXAMPLE 1Same HTML, three styles

The HTML is exactly the same each time. Only the CSS changed. That's the power of CSS!

EXAMPLE 2Can you read it?

Yellow text on white almost disappears! Readable sites have strong contrast (dark on light, or light on dark), text that isn't too small, and only 2 or 3 main colors.

EXAMPLE 3Ask AI for a design, the Prompt Pro way
Prompt"RAct as a friendly web designer. CMy site is about skateboarding, for people my age. EXI like bold colors like a skate park sign: dark blue and bright orange. FWrite a style.css with rules for the body, headings and a .card class, with a comment explaining each rule. LKeep the text easy to read and don't load fonts or anything from other websites."

A role, an example of the style you like and clear limits. Everything from Prompt Pro works for design too!

Byte says

Rule of thumb: pick one main color, one accent color and one or two fonts. Too many colors and fonts makes a site look messy and hard to read.

Part 3 · Spot it

Which Rule Did That?

Each change below was made by one CSS rule. Pick the rule that did it.

Style detective! 🎨

Part 4 · Build it

Restyle the Page

This page has no style yet. Write CSS rules inside the <style> tag to reach the goals. The last goal needs a change in the HTML too!

📄 index.html
Live preview

    The playground only runs inside this page. It can't open other websites or change anything on your computer. Your code is saved in this browser, on this device.

    Part 5 · Try it for real

    Paint Shop Missions

    Time to use your own chatbot. Missions get harder as you go. Bronze is the one to do today. Silver and Gold are extra challenges for when you want more.

    ★ Bronze

    Your Own style.css

    Give your real site its first clothes.

    1. Make a new file in your folder called style.css.
    2. Add the <link rel="stylesheet" href="style.css"> line inside the head of index.html.
    3. Write rules for your background color, text color and heading color. Save both files and refresh.
    ★★ SilverExtra challenge

    Card Style

    Make your sections look like neat cards.

    1. Write a .card rule with a background, padding, rounded corners and a border.
    2. Add class="card" to your sections in the HTML.
    3. Check it's still easy to read!
    ★★★ GoldExtra challenge

    Design Showdown

    Get two designs and choose the best.

    1. Ask your AI tool for two different design ideas using a prompt like Example 3. Code Check both!
    2. Try each one on your site (save a copy of your old style.css first).
    3. Keep the better one, and write down why it's better: readability, colors, how it fits your topic.

    Your notes are saved right in this browser, on this device. They're never sent anywhere.

    Part 6 · Build Log

    Add a page to your Build Log

    Add today's page to your Build Log.

    🛠️ Style It with CSS

    PAGE 3 OF 6

    Your Build Log is saved right in this browser, on this device. It's never sent anywhere.

    Recap

    What you just learned

    Part 7 · Show what you know

    Quick Quiz

    10 questions, picked at random from a bigger question bank. If you take it again, you'll probably see a different mix. Let's go!

    Up next

    Lesson 4 · More Pages and Menus

    Turn your page into a real multi-page website.

    Go to Lesson 4 →