Lesson 1 / 28
What is CSS?
CSS styles HTML — and three ways to attach it to a page.
CSS in one line
CSS (Cascading Style Sheets) describes how HTML elements look — color, spacing, layout, fonts, motion. HTML gives structure; CSS gives appearance.
Three ways to add CSS
Inline (style="..." on a tag), internal (a <style> block in <head>), and external (a separate .css file linked in). External is the standard for real projects.
All three side by side
Same visual result, three attachment points.
<!-- inline -->
<p style="color: crimson;">Inline</p>
<!-- internal -->
<head>
<style>
p { color: crimson; }
</style>
</head>
<!-- external -->
<head>
<link rel="stylesheet" href="styles.css">
</head>Prefer external
External stylesheets are cached by the browser and reused across pages — inline styles are the hardest to maintain and override.