Understanding CSS
Every website you've ever used — Netflix, YouTube, Amazon — is built from three parts that work together. Before we start writing CSS, it helps to understand what each part does.
The Role of HTML
HTML is the foundation. It puts the content on the page — the text, the buttons, the images, the links.
Think of HTML as the skeleton of a webpage. It gives everything shape and order, but it doesn't decide how it looks. If you loaded a page with only HTML and no CSS, you'd see plain black text on a white background — like a Word document.
If you don't know much HTML yet, that's fine. You only need a few basics to follow along here.
Click Try It Yourself to see what a page looks like with only HTML and no CSS.
Netflix
Unlimited movies, TV shows, and more.
Starts at USD 2.99. Cancel anytime.
The Role of CSS
This is where the design starts to take shape.
CSS controls how things look. It tells the browser things like "make this background black," "make that text white," or "put this button in the center." Without CSS, every website would look the same — boring and unstyled.
With CSS, you get Netflix's dark theme, smooth spacing, and clean layout. If HTML builds the walls, CSS paints them and arranges the furniture.
Click Try It Yourself to see the same page with some CSS added.
Netflix
Unlimited movies, TV shows, and more.
Starts at USD 2.99. Cancel anytime.
body { background-color: #000; color: white; font-family: sans-serif; padding: 40px; } h1 { color: #e50914; font-size: 48px; } button { background-color: #e50914; color: white; border: none; padding: 12px 24px; font-size: 16px; border-radius: 4px; cursor: pointer; }The Role of JavaScript
JavaScript adds movement and interactivity. When you click play and a trailer starts, or when a preview appears as you hover over a show — that's JavaScript.
But that comes later. Before we make anything interactive, we need to make it look good. That's what CSS is all about.
What You'll Build
In this course, we'll learn CSS by building something real — a Netflix-style homepage, step by step.
- We'll start with the basics: colors, fonts, and spacing
- Then we'll move into layouts using Flexbox and Grid
- By the end, you'll have a Netflix-style homepage that actually looks professional
Every lesson adds something new to the page. By the time you finish, all the pieces will come together into a full design.
Let's begin by setting up CSS.
Have anything to say about this lesson?
Your feedback helps improve these tutorials. If something was confusing or missing, let us know.