Beep! Tap the happy computer!
Web & AI skills

Can a text file become a page?

# Tiny HTML & CSS A web page is a text file the browser understands. ## HTML — the bones ```html <h1>My Science Project</h1> <p>Plants need sunlight.</p> <img src="leaf.jpg" alt="A green leaf"> ``` - `h1` — big heading - `p` — paragraph - `img` — image (`alt` describes it for screen readers) ## CSS — the clothes ```css h1 { color: darkorange; } p { font-size: 18px; } ``` HTML says *what* it is. CSS says *how it looks*. > Start one file: `index.html`. Open it in a browser. You just published a page… to yourself! ## A five-line page you should actually type ``` <!doctype html> <html> <head><title>My garden</title></head> <body> <h1>Garden</h1> <p>We grow tomatoes.</p> </body> </html> ``` Save as `garden.html` and double-click it. Your browser is the output device. ### Then one CSS rule ``` h1 { color: seagreen; } ``` Either in a `<style>` box or a `.css` file. The heading turns green. Structure stayed the same. That split is the whole lesson. ### Tags to know this year `html` `head` `title` `body` `h1` `h2` `p` `img` `a` (link)

By the end of this lesson

Tell HTML (structure) from CSS (style), and read a 5-line page: title, heading, paragraph, colour.

Remember

  • HTML = structure (heading, paragraph, image, link).
  • CSS = style (colour, size, layout).
  • A tag usually comes in a pair: <p>…</p>.
  • <h1> is a main heading. <p> is a paragraph. <img> shows a picture.
  • Every site you open is (at least) HTML + CSS in the browser.

Worked examples

Cover the answer. Try the steps on paper, then open them.

Example 1 — Read a page

<h1>Garden</h1> <p>We grow tomatoes.</p>

  1. h1 shows a big title Garden
  2. p shows a normal paragraph
  3. The browser draws this as a simple page

Answer: heading + paragraph

Check: Structure first, pretty later.

Example 2 — Who does what

Make the heading blue and the text larger.

  1. HTML already said “this is a heading”
  2. CSS says h1 { color: blue; font-size: 32px; }
  3. Do not use HTML only to make things pretty if you can help it

Answer: HTML structure, CSS style

Check: Separation makes changes easy.

Example 3 — Broken tag

<p>Hello with no </p>.

  1. The browser guesses, and later pieces may look wrong
  2. Close your tags
  3. Beginners’ most common slip after quotes in Python

Answer: close the tag

Check: Pairs: open and close.

Common mistakes

Slip Putting a whole essay in one <h1>.

Fix h1 is the title. Paragraphs use p.

Structure must match meaning.

Slip Saying CSS is a programming language like Python.

Fix CSS is a style language. It does not do general if/loops the way Python does.

Different tool.

Slip Using <img> with no picture file and wondering why a box is empty.

Fix The src must point to a real file or URL.

Path lesson again.

Try on paper first

Write the answer, then tap Reveal. These are not the quiz — they are warm-ups.

1. HTML is for…

Answer: Structure of a page

2. CSS is for…

Answer: Style / look

3. Which tag is a main heading?

Answer: h1

4. A paragraph tag is…

Answer: p

Touch practice

9 tap / type

Tap or type. Use the hint if you need it. Retry any miss — the why is the lesson.

Optional picture lab

After practice

Real world

Every website you open.

Connect

Structure (HTML) + style (CSS).

⭐ Star quiz

9 questions

Do the worked examples and touch practice first. Then take the quiz without peeking.