CSSSetup & Tools

Setup & Tools

The barrier to entry for CSS is genuinely low — you need nothing more than a text editor and a browser. But the right setup makes you dramatically more productive. This page covers what you need to get started, which code editor to use, and the browser tools you'll use every single day.

What you actually need

To write and preview CSS you need exactly two things:

  • A text editor — any program that saves plain text files.

  • A web browser — Chrome, Firefox, Safari, or Edge all work well.

That's it. No installation, no compilation step, no command line. You write a .html file and a .css file, double-click the HTML file to open it in a browser, and you're up and running. This simplicity is one of the things that makes CSS a great first language to learn.

Recommended code editor: VS Code

While any text editor works, Visual Studio Code (VS Code) is the industry standard for web development and the one most developers use daily. It's free, open source, fast, and has excellent built-in support for HTML, CSS, and JavaScript with no configuration.

Text
Download VS Code: https://code.visualstudio.com

Key built-in features for CSS:
  ✓ Syntax highlighting
  ✓ CSS property autocompletion (type "back" and it suggests "background")
  ✓ Colour preview swatches (hover over a colour value to see it)
  ✓ Error highlighting for invalid syntax
  ✓ "Go to definition" for custom properties
Essential VS Code extensions for CSS

Extension

What it does

Prettier

Auto-formats your CSS on save; keeps consistent indentation and spacing

CSS Peek

Ctrl+click a class name in HTML to jump to its CSS definition

IntelliSense for CSS

Smarter autocompletion, including custom property suggestions

Live Server

Saves and auto-reloads the browser when you save a file — no manual refresh

Color Highlight

Colours the background of any colour value in your editor to match it

Live Server is worth installing immediately — manually refreshing the browser every time you save a file is a tiny friction, but it adds up to real slowness over a day of development
Once you install Live Server, right-click your HTML file in VS Code's Explorer panel and choose "Open with Live Server". It starts a local development server and opens the page in your browser. Every time you save any file, the browser automatically refreshes. This simple quality-of-life improvement will make you noticeably faster.
Your file structure

For any CSS project — even a simple one — keep your files organised. Here's a minimal structure to start with:

Text
my-project/
  index.html        ← the HTML structure
  styles.css        ← all your CSS
  images/
    logo.png
    hero.jpg

As projects grow you'll add more CSS files, JavaScript, and folders. But this simple structure is correct for everything you'll build while learning.

Browser DevTools — your most important tool

Browser DevTools are built into every modern browser and they're how professional developers debug CSS. You'll use them constantly. To open them:

  • Windows/Linux: F12 or Ctrl + Shift + I

  • macOS: Cmd + Option + I

  • Right-click any element on a page and choose "Inspect"

The two tabs you'll use most for CSS work are Elements (or Inspector in Firefox) and Styles (or Rules). Click any element on the page and the Styles panel shows you every CSS rule applied to it, where it came from, and what the computed values are. You can even edit styles live — click a value, type a new one, and the page updates instantly. Changes aren't saved back to your file, but it's invaluable for experimenting.

Text
DevTools panels most useful for CSS:

  Elements   → see the DOM tree; click any element
  Styles     → all CSS rules for the selected element, with source
  Computed   → final resolved values after cascade & inheritance
  Layout     → visual Flexbox and Grid overlays
  Changes    → see what you've edited live during this session
Online playgrounds

Sometimes you want to quickly try a CSS idea without setting up a project. These online tools are excellent:

Tool

Best for

CodePen (codepen.io)

Quick experiments; huge community of examples to learn from

CSS Fiddle (jsfiddle.net)

Simple HTML+CSS+JS sandbox

StackBlitz (stackblitz.com)

Full project environments in the browser

CSS Play (play.csssecrets.io)

CSS-specific experiments from CSS expert Lea Verou

Validating your CSS

The W3C provides a free CSS validator at validator.w3.org/css that checks your stylesheet for errors and deprecated properties. It's useful when something seems wrong and you can't find the issue by eye. Invalid CSS properties are silently ignored by the browser (they don't throw an error), which can make typos and syntax mistakes frustratingly hard to spot.

Browsers silently ignore invalid CSS — a typo in a property name or value doesn't produce an error; the rule is just skipped
If you write `colour: red` instead of `color: red` (note the British spelling), the browser won't warn you — it will simply ignore that declaration and leave the text its default colour. This is by design: CSS is built to be forward-compatible (unknown properties from future specs should be ignored gracefully), but it means bugs from typos are invisible unless you're actively looking for them in DevTools. When a style isn't applying and you can't figure out why, open DevTools, select the element, and look for the property in the Styles panel. Invalid declarations appear with a warning icon or strikethrough.
Next
Write your first stylesheet from scratch: [Your First Stylesheet](/css/first-stylesheet).