Typography
We have the right font. Now let's make the text actually look like Netflix — big bold headings, readable subtitles, and text that sits exactly where we want it.
font-size
The font-size property controls how big the text is. The most common unit is px (pixels).
h1 {
font-size: 48px;
}
p {
font-size: 18px;
}
The browser has default sizes — headings are larger than paragraphs — but they're rarely big enough for a real design. Netflix's hero heading is huge. Let's match that.
Click Try It Yourself and change the font sizes. Notice how the page feel changes dramatically just by making the heading bigger.
Netflix
Unlimited movies, TV shows, and more
Starts at USD 2.99. Cancel anytime.
body { background-color: #000; color: white; padding: 40px; margin: 0; font-family: "Roboto", sans-serif; text-align: center; } h1 { font-family: "Bebas Neue", sans-serif; font-size: 64px; color: white; } h2 { font-size: 24px; } p { font-size: 18px; }font-weight
The font-weight property controls how thick or thin the text looks.
h1 {
font-weight: bold; /* thick */
}
p {
font-weight: normal; /* regular */
}
h2 {
font-weight: 700; /* same as bold — using a number */
}
Font weight can be a keyword (normal, bold) or a number from 100 (thinnest) to 900 (heaviest). Most fonts support 400 (normal) and 700 (bold). Some fonts like Roboto have in-between weights like 300 or 500.
line-height
Line height controls the space between lines of text. Without it, lines can feel packed together and hard to read.
p {
line-height: 1.6;
}
The value is a multiplier of the font size. If your text is 18px, a line-height of 1.6 makes the spacing about 29px between lines. Most websites use between 1.5 and 1.8 for body text.
Watch anywhere. Cancel anytime. Join today and get access to thousands of award-winning TV shows, movies, anime, documentaries, and more on any device you own.
body { background-color: #000; color: white; padding: 30px; max-width: 480px; margin: 0 auto; font-family: "Roboto", sans-serif; } p { font-size: 18px; line-height: 1.6; }text-align
The text-align property controls where text sits inside its container.
h1 {
text-align: center;
}
p {
text-align: left; /* default */
}
p {
text-align: right;
}
Netflix centers all the hero text — the big heading, the subtitle, and the email form. Let's do the same.
letter-spacing
Letter spacing adds or removes space between individual characters. A small positive value makes text feel cleaner and more intentional.
h2 {
letter-spacing: 2px;
}
p {
letter-spacing: 0.5px;
}
text-transform
You can change text case entirely in CSS — without touching the HTML.
h1 {
text-transform: uppercase; /* ALL CAPS */
}
p {
text-transform: capitalize; /* First Letter Of Each Word */
}
p {
text-transform: lowercase; /* everything lowercase */
}
Click Try It Yourself to see all these properties working together on our Netflix page.
Netflix
Unlimited movies, TV shows, and more
Starts at USD 2.99. Cancel anytime.
Ready to watch? Enter your email to get started.
body { background-color: rgba(0, 0, 0, 0.8); background-image: url('https://assets.nflxext.com/ffe/siteui/vlv3/9ba9f0e2-b246-47f4-bd1f-3e84c23a5db8/web/NP-en-20251020-TRIFECTA-perspective_774f89dc-b75d-4cfc-b1fe-52086741fae3_large.jpg'); background-blend-mode: multiply; background-size: cover; margin: 0; padding: 60px 40px; color: white; font-family: "Roboto", sans-serif; text-align: center; } h1 { font-family: "Bebas Neue", sans-serif; font-size: 64px; font-weight: 700; letter-spacing: 3px; margin-bottom: 8px; } h2 { font-size: 24px; font-weight: 700; letter-spacing: 1px; margin-bottom: 16px; } p { font-size: 18px; font-weight: 400; line-height: 1.6; }Have anything to say about this lesson?
Your feedback helps improve these tutorials. If something was confusing or missing, let us know.