Full answer
Every browser has a default stylesheet. It gives headings a size, lists a bullet and the body an 8px margin. The defaults are mostly the same across browsers, but not exactly, and some form elements differ.
- A reset removes the defaults. The classic version sets margin, padding and font size to zero or
inheriton almost everything. You then style everything from nothing. The cost is that you must restyle lists, headings and form controls, and the reset can remove useful things, such as the focus outline. - Normalize keeps useful defaults and fixes the differences and bugs between browsers. A heading still looks like a heading. It is a good base for content sites. It is a larger file than a small reset.
- A modern minimal reset is a short set of rules that fix the common pain points and nothing more. Browsers are much closer today than in the past, so most projects need only a few lines.
A sensible start for a new project is a short reset:
*, *::before, *::after { box-sizing: border-box; }so widths include padding and borders.body { margin: 0; line-height: 1.5; }.img, svg, video { display: block; max-width: 100%; height: auto; }so media does not overflow and has no gap under it.input, button, select, textarea { font: inherit; }so form controls use the page font.@media (prefers-reduced-motion: reduce)rules to calm animations, when the project needs them.
Put these in an early layer or at the top of the file, so every other rule can override them easily. Use :where() to keep their specificity at zero.
The input is exactly 100px wide with its padding and border inside. The button uses the page font. The second image is shrunk to its 200px parent, and height: auto lets its height follow the real shape of the picture.
A heavy reset is rarely needed today. Choose the smallest base that solves the problems you have.
<style>
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; font-family: Georgia, serif; }
:where(img, svg, video) { display: block; max-width: 100%; height: auto; }
:where(input, button, select, textarea) { font: inherit; }
</style>
<input id="i" style="width:100px;padding:10px;border:2px solid #000">
<button id="b" type="button">Go</button>
<img id="img" alt="" width="600" height="100" src="/a.png" style="width:600px;">
<div style="width:200px"><img id="img2" alt="" src="/a.png" width="600" height="100"></div>Run in Chrome 156 (headless) as a page; the snippet is wrapped in a minimal HTML document with doctype, charset and viewport meta tag. Two full runs gave identical results, and the measured values in the answer come from them.
Key points
- A reset removes defaults; normalize makes them consistent.
- Browsers are closer today, so a small reset is often enough.
- box-sizing: border-box and fluid media are the common rules.
- Form controls need font: inherit.
- Keep reset rules first and low in specificity.
Common mistakes
- Using a heavy reset that removes the focus outline and list semantics visuals, then forgetting to restore them.
- Putting the reset at the end of the file, where it overrides component styles.
- Copying a large reset without knowing what it changes.
Follow-ups
- Why set box-sizing: border-box on everything?
- Why make the reset rules zero specificity?
Tips
- Describe the three options in one line each.
- Say that you would start with a few lines and add rules only for real problems.