CSS

CSS (Cascading Style Sheets) is the language used to style and lay out HTML content — controlling colors, fonts, spacing, and positioning. It separates how a page looks from what the page contains.

Web

CSS works by selecting HTML elements and applying rules to them, such as making all headings blue or giving buttons rounded corners. The 'cascading' part means rules can override one another based on specificity and order.

Keeping styles in CSS rather than mixing them into HTML makes pages easier to maintain and lets you restyle an entire site by editing one stylesheet.

Examples

CSS

h1 {
  color: navy;
  font-size: 32px;
  text-align: center;
}

Output:

Renders all <h1> headings as centered, navy-blue text at 32px.

Learn it in a lesson

See also

Back to the Dictionary