CSSCSS · Lesson 01

CSS Introduction

Three ways to add CSS and how a rule is built.

Video tutorialTrack course · freeCodeCamp
Speed
Next lesson
Watch 00:00 · 1 checkpoints Watch on YouTube More on this topic
Transcript & captions
8/8

CSS (Cascading Style Sheets) describes how HTML should look. A rule is a selector plus a block of property: value declarations.

csscss
h1 {
  color: #22d3ee;   /* property: value */
  font-size: 2rem;
}
  • Inline: style="color:red" on the element (avoid for real projects).
  • Internal: a <style> block in the <head>.
  • External: <link rel="stylesheet" href="styles.css"> — the recommended way.
Try it yourself

Knowledge check

0/1 answered

Which way of adding CSS scales best across many pages?