CSS (Cascading Style Sheets)
Written by Andy Sim
Last updated
CSS, or Cascading Style Sheets, is the code that controls how a web page looks: colours, fonts, spacing, layout and how the design adapts to different screens.
HTML provides the content and CSS styles it. A single stylesheet can set the look of the whole site, so a change to one rule updates every page. Media queries let the same page rearrange itself for a phone, a tablet or a desktop.
Examples
- A rule that sets all headings to the brand colour.
- A layout that moves from three columns on a computer to one on a phone.
- Dark mode that changes the colours automatically.
Why it matters for your website
CSS is what makes your site look professional and work on every screen. Keeping the styles in one tidy file also keeps pages fast, while messy or oversized CSS slows loading.