What is CSS? — CSS Technical Interview Questions & Answers
The language that styles and lays out HTML.
What is CSS?
- The language that styles and lays out HTML.
- CSS is the look of the page: colour, size, space, layout. HTML says ‘this is a heading’. CSS says ‘make headings navy and 28px’. You write rules: selector { property: value; }
- h1 { color: navy; } changes every h1. .card { padding: 16px; } is a class. #logo is an id. Prefer classes for styling.
- Trap: inline style on every tag. Trap: thinking CSS is a programming language with if/loops (it isn’t; you can get clever with queries, but start with rules).
Technical Interview Tip: h1 { color: navy; } — HTML structure, CSS look.
Code Examples for What is CSS?
What is CSS? — working example
/* CSS styles HTML via selectors + declarations */
h1 {
color: #1e293b;
font-size: 2rem;
}
.card {
background: #f8fafc;
padding: 1rem;
border: 1px solid #cbd5e1;
}What is CSS? — cSS (Cascading Style Sheets) controls presentation: colors, typography, layout, and visuals.
How to Explain What is CSS? to an Interviewer
What is CSS?
Style language for HTML selector { property: value; }