Skip to content
AgileLogics
4 min read

What Is CSS?

CSS (Cascading Style Sheets) is the language that controls how web pages look: colors, fonts, spacing, layout, and animation. HTML says what the content is; CSS says how it should be presented.

h1 {
  color: darkslateblue;
  font-family: Georgia, serif;
}

p {
  max-width: 60ch;
  line-height: 1.6;
}

.button {
  background: teal;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
}

Applied to a page, this makes every h1 dark blue in a serif font, keeps paragraphs to a comfortable reading width with generous line spacing, and turns anything with class="button" into a teal, rounded button.

Each rule has a selector (which elements) and declarations (which properties get which values).

Why "cascading"?

Many rules can apply to the same element — from the browser's defaults, from your stylesheets, from the user's settings. The cascade is the algorithm that decides which one wins. Understanding it is the key to CSS, and this course returns to it several times.

Separation of concerns

Language Job
HTML Structure and meaning
CSS Presentation
JavaScript Behavior

Because the style lives separately from the content, one stylesheet can restyle a whole website, the same HTML can look different on a phone, a wide screen, and paper, and users can override styles they can't read.

A living language

CSS was proposed by Håkon Wium Lie in 1994, and CSS 1 became a W3C recommendation in 1996. After CSS 2.1, the language was split into modules (Selectors, Flexbox, Grid, Color, ...) that evolve independently, so there is no "CSS 4". The W3C publishes a yearly snapshot of which modules are stable. Browsers now add features quickly and in step with each other, and Baseline labels (on MDN and web.dev) tell you when a feature works in all major browsers. This course notes support when a feature is new.