When you create a new HTML page, the browser does not start with completely unstyled elements. Browsers provide their own default user-agent styles for elements such as headings, paragraphs, lists, buttons, inputs, tables, and other controls. These defaults are useful, but they can also create differences between browsers and make the starting point of a design less predictable.
A CSS reset is a collection of CSS rules designed to reduce or remove selected browser defaults. Normalize.css, on the other hand, takes a different approach: instead of aggressively removing browser styles, it aims to make useful default behavior more consistent across browsers. Both approaches are intended to provide a predictable foundation for writing application CSS.
CSS Reset vs Normalize.css
Removes or neutralizes many browser default styles so you can define the visual system yourself.
Preserves useful defaults where possible while normalizing important differences between browsers.
What Is a CSS Reset?
A CSS reset is a stylesheet that changes the browser's default rendering rules before your application's own styles are applied. The purpose is to reduce unwanted default margins, inconsistent sizing, typography differences, and other browser-specific starting styles.
A reset does not create your design. It gives your project a cleaner baseline from which you can define your own spacing, typography, colors, layout, and component styles.
Why Do Browsers Have Default Styles?
HTML elements have meaning even without a custom stylesheet. A browser needs a reasonable default presentation for headings, lists, links, tables, buttons, and form fields so basic documents remain usable.
For example, headings usually appear larger and paragraphs are separated visually. Lists commonly include indentation and markers. Links are typically visually distinct from normal text. These defaults are helpful for plain HTML, but a custom application may want a completely different design system.
<h1>Website Title</h1>
<p>
This is a paragraph.
</p>
<ul>
<li>First item</li>
<li>Second item</li>
</ul>
Without custom CSS, these elements can still have default spacing and typography supplied by the browser.
Why Use a CSS Reset?
Predictability
Start with a controlled baseline rather than relying on many browser defaults.
Consistency
Reduce unnecessary differences across browsers and platforms.
Faster Styling
Spend less time fighting unexpected default margins, sizing, and spacing.
The Classic CSS Reset
One of the most recognizable reset approaches removes margin and padding from a broad set of elements and resets their box sizing.
html,
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
li {
margin: 0;
padding: 0;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
This type of reset gives you a very clean starting point, but it also removes useful defaults that you may need to recreate explicitly. Modern projects therefore often use a more targeted reset instead of eliminating every browser style.
Modern Minimal CSS Reset
A modern reset can focus on a few high-value rules rather than resetting every property on every element.
*,
*::before,
*::after {
box-sizing: border-box;
}
html {
line-height: 1.5;
}
body {
margin: 0;
}
img,
picture,
svg,
canvas {
display: block;
max-width: 100%;
}
button,
input,
textarea,
select {
font: inherit;
}
The exact reset should match the needs of the application. There is no requirement that every project use one universal reset.
Why box-sizing: border-box Is Common in Resets
The default box-sizing behavior for most elements is content-box.
With content-box, declared width and height describe the content box, while padding and border are added outside that size.
Setting box-sizing: border-box makes the declared width and height include the element's padding and border.
This often makes layout calculations easier to reason about.
*,
*::before,
*::after {
box-sizing: border-box;
}
This pattern is extremely common in application stylesheets because it makes component sizing more predictable.
Resetting Body Margin
Browsers commonly provide a default margin around the document body. Many web applications remove that margin so the application can control page spacing explicitly.
body {
margin: 0;
}
This is one of the simplest and most commonly used reset declarations.
Should You Reset Heading Margins?
Many design systems choose to reset heading margins and define spacing through component or typography styles. This gives the application more control over vertical rhythm.
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
}
However, removing all heading margins means your stylesheet must deliberately add spacing where headings need it. That is a design decision rather than a rule that every website must follow.
Resetting Paragraph and List Spacing
Paragraphs and lists often receive browser-provided margins. Some projects reset these values and introduce their own typography system.
p,
ul,
ol {
margin: 0;
padding: 0;
}
Be careful with lists because removing their markers can also remove useful visual information. If you use lists for content, restore the appropriate presentation when needed.
Resetting List Styles
Navigation menus and UI lists often do not need traditional list markers. A common component-level style is:
nav ul {
list-style: none;
margin: 0;
padding: 0;
}
This is generally better than globally removing list styling from every ul and ol,
because content lists may still benefit from their semantic markers and default-like presentation.
Images in a CSS Reset
Images can overflow their containers when their intrinsic width is larger than the available space. A common baseline rule is:
img,
picture {
max-width: 100%;
height: auto;
}
This allows images to shrink with responsive containers while preserving their aspect ratio when height remains automatic.
Why display: block Is Often Used for Images
Images are inline-level replaced elements by default.
Setting them to display: block can remove the small inline formatting gap that can appear beneath images when they are aligned within text-like formatting.
img,
picture,
svg,
canvas {
display: block;
}
This is a layout preference commonly used in application resets, not a universal accessibility requirement.
Form Controls in a CSS Reset
Form controls can use browser-specific typography or default appearance. A useful baseline is to make controls inherit the surrounding font.
button,
input,
textarea,
select {
font: inherit;
}
This helps buttons and form fields visually match the surrounding typography without requiring repeated font declarations.
Should You Remove Button Borders?
A reset sometimes includes rules such as:
button {
border: 0;
background: none;
}
This gives the developer full control over the button's appearance, but it can also remove useful browser defaults. When doing this, make sure you add back appropriate background, border, padding, focus, hover, and disabled states.
Never Remove Focus Without a Replacement
Accessibility is one of the most important considerations when creating a reset. A reset should not remove keyboard focus indicators just because the browser's default outline does not match the design.
/* Dangerous as a standalone rule */
*:focus {
outline: none;
}
Instead, provide a deliberate focus style:
:focus-visible {
outline: 3px solid #2563eb;
outline-offset: 3px;
}
A reset should make the starting point more predictable, not make the interface harder to navigate.
What Is Normalize.css?
Normalize.css is an approach to cross-browser styling that aims to make useful browser defaults more consistent rather than resetting almost everything to zero.
The philosophy is different from an aggressive reset. Instead of saying "remove browser styles and rebuild everything," normalization focuses on reducing inconsistencies while preserving practical defaults where appropriate.
CSS Reset vs Normalize.css
| Feature | CSS Reset | Normalize.css |
|---|---|---|
| Main Goal | Reduce or remove many browser defaults. | Normalize useful browser behavior and reduce inconsistencies. |
| Starting Point | Very neutral baseline. | More browser-like defaults with consistency fixes. |
| Developer Control | High, but requires more explicit styling. | Retains more built-in behavior. |
| Approach | Reset and rebuild. | Normalize and preserve. |
When Should You Use a CSS Reset?
A reset is useful when your project has a strong design system and you want components to define spacing, typography, and visual appearance deliberately.
Good Fit
- Custom design systems.
- Component libraries.
- Large application interfaces.
- Projects where spacing is fully controlled by CSS.
Be Careful
- Content-heavy websites that depend on useful browser defaults.
- Simple pages where a large reset adds unnecessary complexity.
- Projects where developers have not planned replacement styles.
- Accessibility-sensitive components with customized native controls.
When Should You Use Normalize.css?
Normalization can be useful when you want to retain reasonable browser defaults while reducing browser-specific inconsistencies. It is particularly useful for teams that want a standardized baseline without completely rebuilding the presentation of common HTML elements.
However, many modern applications now use smaller custom resets or framework-provided base styles rather than adding a large third-party normalization stylesheet. The right choice depends on your stack and the amount of browser normalization your project actually needs.
Should You Use Both Reset and Normalize.css?
Usually, you should not blindly combine a full reset with a normalization stylesheet. Both approaches are trying to establish a baseline, but they have different philosophies. Combining large overlapping stylesheets can make the cascade harder to understand and can create unnecessary overrides.
Choose a deliberate baseline and understand what it changes before adding another reset layer on top.
CSS Reset and the Cascade
Reset styles participate in the normal CSS cascade. The order in which your reset, component styles, utilities, and third-party styles are loaded can affect the final result.
/* Reset */
button {
margin: 0;
}
/* Component */
.button {
margin-top: 1rem;
}
The component rule still works because it targets a different selector and property context. In larger applications, explicit organization of reset, component, and utility styles can make these relationships easier to understand.
CSS Reset and Accessibility
A CSS reset must be designed with accessibility in mind. Resetting styles can unintentionally remove visual cues that users depend on.
Preserve
- Visible keyboard focus.
- Readable text.
- Useful link distinction.
- Logical content structure.
- Usable native controls.
Avoid Removing Blindly
- All focus outlines.
- All list markers.
- All button affordances.
- Useful form control feedback.
- Content spacing needed for readability.
A Practical Modern CSS Reset
Here is an example of a small reset that provides a predictable baseline without attempting to erase every browser behavior.
/* Box sizing */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Document */
html {
line-height: 1.5;
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
}
/* Media */
img,
picture,
svg,
canvas,
video {
display: block;
max-width: 100%;
}
/* Form controls */
button,
input,
textarea,
select {
font: inherit;
}
/* Headings and paragraphs */
h1,
h2,
h3,
h4,
h5,
h6,
p {
overflow-wrap: break-word;
}
/* Buttons */
button {
cursor: pointer;
}
/* Focus */
:focus-visible {
outline: 3px solid #2563eb;
outline-offset: 3px;
}
This is only an example. A production reset should be adjusted for the application's requirements, browser support strategy, component system, and accessibility goals.
Reset vs Component Styles
A good reset should establish a baseline rather than contain every component design rule. Button colors, card shadows, navigation layouts, form spacing, and application-specific typography usually belong to component or design-system styles.
Normalize the baseline.
Define reusable UI appearance.
Apply focused layout and visual adjustments.
Common CSS Reset Mistakes
Removing Everything
A huge reset can create more work by forcing you to rebuild useful browser behavior and typography from scratch.
Removing Focus Outlines
Never remove keyboard focus without providing an equally clear replacement.
Removing List Styles Globally
Content lists may depend on visible markers, so list resets are often better scoped to components such as navigation menus.
Resetting Form Controls Without Restyling Them
Removing useful native styles without replacing states such as focus and disabled can create poor usability.
Using Multiple Overlapping Resets
Combining unrelated reset stylesheets can make the cascade harder to understand and debug.
Assuming Every Browser Difference Requires a Reset
Modern browsers are generally much more consistent than older environments, so reset only what your project actually needs.
CSS Reset Best Practices
- Keep the reset small and purposeful.
- Use
box-sizing: border-boxwhen it matches your layout strategy. - Remove body margin when your design needs full control of page spacing.
- Make responsive media elements fit their containers.
- Allow form controls to inherit the application's typography when appropriate.
- Do not remove focus indicators without replacing them.
- Scope list resets to components where list markers are intentionally not required.
- Avoid overlapping reset stylesheets that create unnecessary cascade complexity.
- Keep component-specific styling out of the global reset where possible.
- Test the reset with real headings, paragraphs, lists, links, forms, tables, images, and interactive controls.
Key Takeaways
A CSS reset reduces or removes selected browser default styles to give developers a more controlled starting point.
Normalize.css follows a different philosophy by preserving useful defaults while making browser behavior more consistent.
There is no single reset that every project must use. A small, intentional baseline is often easier to maintain than an aggressive global reset.
box-sizing: border-box is commonly included because it makes width and height calculations easier to reason about.
Responsive images can be supported with max-width: 100% and appropriate display and sizing rules.
Form controls can use font: inherit to keep typography consistent with the surrounding application.
Do not remove focus indicators, useful list semantics, or other browser behavior without providing an intentional replacement.
The reset should establish the baseline; reusable component styles should define the actual appearance of the application's UI.