Module 14: Introduction to CSS

Lesson 1 of 5 · 15–25 minutes

What CSS is

🏠The everyday picture

Two houses with the same rooms and walls (the HTML) can look completely different inside: paint, furniture, lighting. That decoration is CSS. You can redecorate without moving a single wall.

📘What it really is

🖱️Try it

Create my-first-site/css/style.css. In the <head> of every page, add:

<link rel="stylesheet" href="css/style.css">

In style.css, type body { background: lightyellow; }, save, and refresh each page. All three change at once.

✅Quick check

Your site has 20 pages and you want to change the heading colour everywhere. Where should the change be made?

Show the answer

In the one external stylesheet that every page links to.

An AI fixes a layout bug by adding style="..." to 15 elements. What's the concern?

Show the answer

Inline styles are scattered and hard to maintain. Ask for the fix to go in the stylesheet, using classes.

← BackModule 14
ProLearners Assist