Web & APIs

CSS · Cascading Style Sheets

/ see-ess-ESS /

CSS is the language that styles a web page — the colors, fonts, spacing, and layout. If HTML is the skeleton, CSS is the skin and clothes: it takes that plain structure and decides how everything actually looks.

You write CSS as a list of rules. Each rule picks something on the page (a 'selector') and then sets its properties: make every heading dark blue, give paragraphs a comfy line height, lay the navigation out in a row. Change one rule and every matching element updates at once.

The 'cascading' part is the clever bit: when several rules touch the same element, CSS has a clear set of priorities for which one wins. That's how a site keeps a consistent look while still letting you override just one button or one page when you need to.

h1 {
  color: navy;
  font-size: 2rem;
}

One rule: make every <h1> heading navy and a bit bigger.

HTML and CSS split work on purpose — structure in one place, looks in another. That's why you can totally restyle a site without touching its content.

Also called
cascading style sheetsstylesstylesheet