<htmlstart/>

Introduction to CSS

What is CSS and how does it work with HTML?

What is CSS?

CSS stands for Cascading Style Sheets. It controls how HTML elements look — colors, fonts, spacing, layout, and more.

HTML is the structure. CSS is the design.

<!-- HTML -->
<p>Hello, World!</p>

<!-- CSS -->
<style>
  p {
    color: red;
    font-size: 24px;
  }
</style>

3 Ways to Add CSS

MethodWhereBest for
Inlinestyle attribute on elementOne-off overrides
Internal<style> tag in <head>Single-page styles
ExternalSeparate .css file via <link>All real projects
<!-- External (recommended) -->
<link rel="stylesheet" href="style.css">
Always use external CSS for real projects — it keeps HTML clean and lets you reuse styles across pages.
🧩

Test Yourself

4 questions
Q1.What does CSS stand for?
Q2.CSS controls which aspect of a webpage?
Q3.Which CSS method is recommended for real projects?
Q4.HTML is to structure as CSS is to ___