CSS · Layout and visual systems

What is CSS and what problem does it solve?

EasycssstylingbrowserUpdated Oct 2026
Quiz this track

Short answer

CSS is a declarative language for describing how documents should be presented. It separates presentation from structure, letting the browser resolve styles, layout, paint and compositing.

CSS stands for Cascading Style Sheets. You write rules that match elements and declare how those elements should look, and the browser decides the final values through the cascade. You describe the outcome rather than issuing drawing commands.

css
:root {
  --brand: #2563eb;
}

.card {
  color: var(--brand);
  padding: 1rem;
  border: 1px solid #d1d5db;
}

What the browser does with it

  • Parses the stylesheet into the CSSOM and matches selectors to the DOM
  • Resolves the cascade, inheritance and computed values
  • Runs layout to calculate the size and position of every box
  • Paints pixels and composites layers on the screen

Separating structure from presentation means the same HTML can be styled for different contexts, themes and screen sizes. It also means styles are reusable across pages instead of being repeated inline.

Most CSS problems are not syntax errors. They come from cascade resolution, an unexpected containing block, or a formatting context you did not intend.

Follow-ups you should expect

Interviewers use these to check whether the first answer was understanding or memorisation.

  1. 1What is the difference between HTML and CSS responsibilities?
  2. 2What does the browser do between parsing CSS and painting?
  3. 3Why is CSS called declarative?
  4. 4Where does the cascade fit into the rendering process?

Say it in the interview

CSS is a declarative stylesheet language for presentation. I write rules that match elements, and the browser resolves which declarations win, computes values, lays out boxes, and paints them. The point is separating structure from presentation so styles are reusable and themeable. Most bugs I debug are not syntax mistakes but cascade or layout behaviour.

Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.

Related questions

Reading is step one

Now say it out loud.

Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live CSS mock interview and get scored feedback on depth, clarity and confidence.