What is "reset CSS"?
Reset CSS is a set of styles that zeroes out (resets) the browser's default styles: spacing, heading sizes, list styling, and other properties that different browsers apply differently by default.
The purpose of a reset file is to make the page look the same across all browsers, without unexpected built-in spacing and styles.
Why it's needed
- browsers have different default styles for the same elements
- without a reset, layout can "shift" between different browsers
- it lets you start styling "from scratch"
What it looks like
A classic reset.css might contain, for example:
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}And the famous reset by Eric Meyer includes resets for dozens of tags.
An alternative to reset: Normalize.css
There is a more modern option, normalize.css, which does not zero styles out but aligns browser styles, keeping useful defaults (for example, sensible line-height and form styling).
Summary
Reset CSS is a file that strips out the browser's base styles so the developer controls the appearance of elements from scratch. It's used in almost every project, though it's increasingly being replaced by normalize.css for a softer, tidier baseline.
Short Answer
Interview readyA concise answer to help you respond confidently on this topic during an interview.