Unit 1 · Module 2

CSS — The Skin

How things look, separate from what they are

HTML is done describing what things are. Now CSS comes in and says "here's how they should look."

CSS stands for Cascading Style Sheets. Don't worry about what "cascading" means yet. The important part is style — it's all about appearance.

If HTML is the skeleton, CSS is the skin, the clothes, the makeup. It doesn't change what the thing is. An h1 is still a heading. But CSS can make it blue, centered, huge, italic. Change its appearance completely.

CSS rules

You write CSS rules that say "for this thing, apply these looks."

Styling a heading

h1 {
  color: blue;
  font-size: 32px;
  text-align: center;
}

Translation: "For every h1 tag on the page, make the text blue, make it 32 pixels big, and center it."

The h1 is the selector — it says which thing you want to style. The stuff inside the curly braces is the styling — the actual looks you want to apply.

Complete separation

CSS has zero opinion about structure. It doesn't care what an h1 is for or what role it plays. It just says "I can make this look however you want."

HTML has zero opinion about looks. HTML will never say "make this blue" or "center this." That's not its job.

They're completely separate concerns. That's why they're separate languages.

Why CSS can be messy

CSS is simple in concept — pick something, style it — but it gets complicated fast in real apps.

Imagine you have 50 buttons on your website. You write a CSS rule that says "all buttons should be blue." Great. Then you realize one button needs to be red because it's a delete button. So you write another rule for that specific button.

Then you add more buttons. Some need to be small. Some large. Some are in a form, some in navigation. Now you have 15 different button rules scattered through your CSS, and they're fighting each other.

This is called the specificity problem. Different CSS rules can conflict, and it becomes a puzzle to figure out which rule wins. Change one rule thinking it'll fix one button, and it breaks five others.

For now, the key takeaway: CSS gets unwieldy as apps grow. Knowing that helps you plan better from the start. We'll go deeper on CSS organization in Module 5 (File Structure) and Module 7 (Your First Real App Structure).

Style it: The same button, now with CSS

Remember the plain HTML button from the previous page? Here's what happens when CSS gets involved.

HTML + CSS

Same button, but now CSS is styling it

Code

<button>Schedule Appointment</button>

/* CSS */
button {
  background-color: #4CAF50;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
}

Result

Same HTML. Same button tag. But now it looks polished — green background, white text, rounded corners, comfortable padding. CSS did all of that without touching the HTML at all.

Go ahead and try clicking it though. Nothing happens. It looks great, but it doesn't do anything yet. That's the next page — JavaScript.