Glossary

CSS

Definition: Cascading Style Sheets is the language used to describe the visual presentation of HTML documents — layout, colours, fonts and animations.

CSS (Cascading Style Sheets) controls the visual appearance of HTML elements. While HTML defines what content is on a page, CSS defines how that content looks — its colour, typography, spacing, layout and animations. The "cascading" in the name refers to the priority rules that determine which styles apply when multiple rules target the same element.

CSS Selectors

  • Elementp { color: red; } targets all paragraphs.
  • Class.btn { padding: 8px; } targets elements with class="btn".
  • ID#header { } targets the element with id="header".
  • Pseudo-classa:hover { } targets links on mouse hover.

The Box Model

Every HTML element is a rectangular box. From inside out: content → padding → border → margin.

Modern Layout Systems

  • Flexbox — One-dimensional layout for rows or columns.
  • CSS Grid — Two-dimensional layout for complex page structures.
  • CSS Custom Properties (variables)--primary: #6366f1; for reusable values.

CSS Specificity

When multiple rules conflict, the more specific rule wins. Specificity order: inline styles > IDs > classes > elements.